Skip to content

Commit 2508036

Browse files
authored
Merge pull request #25927 from lalinsky/netbsd-madv
Fix madvice/msync flags for BSDs
2 parents 06d08da + 6bdea35 commit 2508036

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

lib/std/c.zig

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,15 @@ pub const MADV = switch (native_os) {
15991599
pub const SEQUENTIAL = 0x5;
16001600
pub const RANDOM = 0x6;
16011601
},
1602+
.netbsd, .openbsd => struct {
1603+
pub const NORMAL = 0;
1604+
pub const RANDOM = 1;
1605+
pub const SEQUENTIAL = 2;
1606+
pub const WILLNEED = 3;
1607+
pub const DONTNEED = 4;
1608+
pub const SPACEAVAIL = 5;
1609+
pub const FREE = 6;
1610+
},
16021611
else => void,
16031612
};
16041613
pub const MCL = switch (native_os) {
@@ -1631,7 +1640,17 @@ pub const MSF = switch (native_os) {
16311640
pub const DEACTIVATE = 0x8;
16321641
pub const SYNC = 0x10;
16331642
},
1634-
.openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => struct {
1643+
.freebsd, .dragonfly => struct {
1644+
pub const SYNC = 0;
1645+
pub const ASYNC = 1;
1646+
pub const INVALIDATE = 2;
1647+
},
1648+
.openbsd => struct {
1649+
pub const ASYNC = 1;
1650+
pub const SYNC = 2;
1651+
pub const INVALIDATE = 4;
1652+
},
1653+
.haiku, .netbsd, .illumos => struct {
16351654
pub const ASYNC = 1;
16361655
pub const INVALIDATE = 2;
16371656
pub const SYNC = 4;

0 commit comments

Comments
 (0)