From 7f32c799a95dd8a54ca7f984f41524021ceee2ce Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Sat, 27 Feb 2021 23:30:28 +0100 Subject: [PATCH] os/bits/linux: add the fadvise advice values --- lib/std/os/bits/linux.zig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 7cde83a608..8887e9d223 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -2408,6 +2408,27 @@ pub const MADV_PAGEOUT = 21; pub const MADV_HWPOISON = 100; pub const MADV_SOFT_OFFLINE = 101; +pub const POSIX_FADV_NORMAL = 0; +pub const POSIX_FADV_RANDOM = 1; +pub const POSIX_FADV_SEQUENTIAL = 2; +pub const POSIX_FADV_WILLNEED = 3; +pub usingnamespace switch (arch) { + .s390x => if (@typeInfo(usize).Int.bits == 64) + struct { + pub const POSIX_FADV_DONTNEED = 6; + pub const POSIX_FADV_NOREUSE = 7; + } + else + struct { + pub const POSIX_FADV_DONTNEED = 4; + pub const POSIX_FADV_NOREUSE = 5; + }, + else => struct { + pub const POSIX_FADV_DONTNEED = 4; + pub const POSIX_FADV_NOREUSE = 5; + }, +}; + pub const __kernel_timespec = extern struct { tv_sec: i64, tv_nsec: i64,