authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-05-31 23:17:08+01:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2023-06-22 10:21:48+00:00
log64f0059cd33b571d6cf91df45f4cb2e0af9c0742
tree9f64b090f6342442ce07e680eb608402cccd65f2
parent82470d4f892af2efa64acd58ab3188fa917ace0c

std.c: update netbsd/openbsd mman constants


2 files changed, 26 insertions(+), 0 deletions(-)

lib/std/c/netbsd.zig+16
......@@ -579,6 +579,12 @@ pub const PROT = struct {
579579 pub const READ = 1;
580580 pub const WRITE = 2;
581581 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 }
582588};
583589
584590pub const CLOCK = struct {
......@@ -621,6 +627,16 @@ pub const MAP = struct {
621627 pub const ALIGNMENT_64PB = MAP.ALIGNED(56);
622628};
623629
630pub 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
624640pub const MSF = struct {
625641 pub const ASYNC = 1;
626642 pub const INVALIDATE = 2;
lib/std/c/openbsd.zig+10
......@@ -466,6 +466,16 @@ pub const MAP = struct {
466466 pub const CONCEAL = 0x8000;
467467};
468468
469pub const MADV = struct {
470 pub const NORMAL = 0;
471 pub const RANDOM = 1;
472 pub const SEQUENTIAL = 2;
473 pub const WILLNEED = 3;
474 pub const DONTNEED = 4;
475 pub const SPACEAVAIL = 5;
476 pub const FREE = 6;
477};
478
469479pub const MSF = struct {
470480 pub const ASYNC = 1;
471481 pub const INVALIDATE = 2;