| ... | @@ -579,6 +579,12 @@ pub const PROT = struct { | ... | @@ -579,6 +579,12 @@ pub const PROT = struct { |
| 579 | pub const READ = 1; | 579 | pub const READ = 1; |
| 580 | pub const WRITE = 2; | 580 | pub const WRITE = 2; |
| 581 | pub const EXEC = 4; | 581 | pub const EXEC = 4; |
| | 582 | pub fn MPROTECT(flag: u32) u32 { |
| | 583 | return flag << 3; |
| | 584 | } |
| | 585 | pub fn MPROTECT_EXTRACT(flag: u32) u32 { |
| | 586 | return (flag >> 3) & 0x7; |
| | 587 | } |
| 582 | }; | 588 | }; |
| 583 | | 589 | |
| 584 | pub const CLOCK = struct { | 590 | pub const CLOCK = struct { |
| ... | @@ -621,6 +627,16 @@ pub const MAP = struct { | ... | @@ -621,6 +627,16 @@ pub const MAP = struct { |
| 621 | pub const ALIGNMENT_64PB = MAP.ALIGNED(56); | 627 | pub const ALIGNMENT_64PB = MAP.ALIGNED(56); |
| 622 | }; | 628 | }; |
| 623 | | 629 | |
| | 630 | pub const MADV = struct { |
| | 631 | pub const NORMAL = 0; |
| | 632 | pub const RANDOM = 1; |
| | 633 | pub const SEQUENTIAL = 2; |
| | 634 | pub const WILLNEED = 3; |
| | 635 | pub const DONTNEED = 4; |
| | 636 | pub const SPACEAVAIL = 5; |
| | 637 | pub const FREE = 6; |
| | 638 | }; |
| | 639 | |
| 624 | pub const MSF = struct { | 640 | pub const MSF = struct { |
| 625 | pub const ASYNC = 1; | 641 | pub const ASYNC = 1; |
| 626 | pub const INVALIDATE = 2; | 642 | pub const INVALIDATE = 2; |