Skip to content

Commit

Permalink
os/bits/linux: add the fadvise advice values
Browse files Browse the repository at this point in the history
  • Loading branch information
vrischmann committed May 7, 2021
1 parent 84d5cc3 commit c8a9cfb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/std/os/bits/linux.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2402,6 +2402,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 (builtin.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,
Expand Down

0 comments on commit c8a9cfb

Please sign in to comment.