Skip to content

Commit 0db7eef

Browse files
committed
os/bits/linux: add the fadvise advice values
1 parent 322215b commit 0db7eef

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
@@ -2409,6 +2409,27 @@ pub const MADV_PAGEOUT = 21;
24092409
pub const MADV_HWPOISON = 100;
24102410
pub const MADV_SOFT_OFFLINE = 101;
24112411

2412+
pub const POSIX_FADV_NORMAL = 0;
2413+
pub const POSIX_FADV_RANDOM = 1;
2414+
pub const POSIX_FADV_SEQUENTIAL = 2;
2415+
pub const POSIX_FADV_WILLNEED = 3;
2416+
pub usingnamespace switch (arch) {
2417+
.s390x => if (@typeInfo(usize).Int.bits == 64)
2418+
struct {
2419+
pub const POSIX_FADV_DONTNEED = 6;
2420+
pub const POSIX_FADV_NOREUSE = 7;
2421+
}
2422+
else
2423+
struct {
2424+
pub const POSIX_FADV_DONTNEED = 4;
2425+
pub const POSIX_FADV_NOREUSE = 5;
2426+
},
2427+
else => struct {
2428+
pub const POSIX_FADV_DONTNEED = 4;
2429+
pub const POSIX_FADV_NOREUSE = 5;
2430+
},
2431+
};
2432+
24122433
pub const __kernel_timespec = extern struct {
24132434
tv_sec: i64,
24142435
tv_nsec: i64,

0 commit comments

Comments
 (0)