Skip to content

Commit d1d4b14

Browse files
committed
os/bits/linux: add the fadvise advice values
1 parent 867ae50 commit d1d4b14

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/std/os/bits/linux.zig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,27 @@ pub const MADV_PAGEOUT = 21;
22452245
pub const MADV_HWPOISON = 100;
22462246
pub const MADV_SOFT_OFFLINE = 101;
22472247

2248+
pub const POSIX_FADV_NORMAL = 0;
2249+
pub const POSIX_FADV_RANDOM = 1;
2250+
pub const POSIX_FADV_SEQUENTIAL = 2;
2251+
pub const POSIX_FADV_WILLNEED = 3;
2252+
pub usingnamespace switch (builtin.arch) {
2253+
.s390x => if (@typeInfo(usize).Int.bits == 64)
2254+
struct {
2255+
pub const POSIX_FADV_DONTNEED = 6;
2256+
pub const POSIX_FADV_NOREUSE = 7;
2257+
}
2258+
else
2259+
struct {
2260+
pub const POSIX_FADV_DONTNEED = 4;
2261+
pub const POSIX_FADV_NOREUSE = 5;
2262+
},
2263+
else => struct {
2264+
pub const POSIX_FADV_DONTNEED = 4;
2265+
pub const POSIX_FADV_NOREUSE = 5;
2266+
},
2267+
};
2268+
22482269
pub const __kernel_timespec = extern struct {
22492270
tv_sec: i64,
22502271
tv_nsec: i64,

0 commit comments

Comments
 (0)