authorgravatar for vincent@rischmann.frVincent Rischmann <vincent@rischmann.fr> 2021-02-27 23:30:28+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-06-09 18:15:50+03:00
log7f32c799a95dd8a54ca7f984f41524021ceee2ce
tree0268670f4602de9eee6c479f6fbd4ba48d2688c3
parent21af264e3a48ce6d6b3a93051c179778304e98af

os/bits/linux: add the fadvise advice values


1 files changed, 21 insertions(+), 0 deletions(-)

lib/std/os/bits/linux.zig+21
......@@ -2408,6 +2408,27 @@ pub const MADV_PAGEOUT = 21;
24082408pub const MADV_HWPOISON = 100;
24092409pub const MADV_SOFT_OFFLINE = 101;
24102410
2411pub const POSIX_FADV_NORMAL = 0;
2412pub const POSIX_FADV_RANDOM = 1;
2413pub const POSIX_FADV_SEQUENTIAL = 2;
2414pub const POSIX_FADV_WILLNEED = 3;
2415pub usingnamespace switch (arch) {
2416 .s390x => if (@typeInfo(usize).Int.bits == 64)
2417 struct {
2418 pub const POSIX_FADV_DONTNEED = 6;
2419 pub const POSIX_FADV_NOREUSE = 7;
2420 }
2421 else
2422 struct {
2423 pub const POSIX_FADV_DONTNEED = 4;
2424 pub const POSIX_FADV_NOREUSE = 5;
2425 },
2426 else => struct {
2427 pub const POSIX_FADV_DONTNEED = 4;
2428 pub const POSIX_FADV_NOREUSE = 5;
2429 },
2430};
2431
24112432pub const __kernel_timespec = extern struct {
24122433 tv_sec: i64,
24132434 tv_nsec: i64,