diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 7469012812eca492c7ed777325aad324a0a4c28a..73b6df9667cc6714537e4ebc92c9f4836ebbcdab 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -365,6 +365,13 @@ pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; pub const POSIX_MADV_WILLNEED: ::c_int = 3; pub const POSIX_MADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NORMAL: ::c_int = 0; +pub const POSIX_FADV_RANDOM: ::c_int = 1; +pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_FADV_WILLNEED: ::c_int = 3; +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + pub const _SC_IOV_MAX: ::c_int = 56; pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; @@ -630,6 +637,10 @@ extern { hdtr: *mut ::sf_hdtr, sbytes: *mut ::off_t, flags: ::c_int) -> ::c_int; + + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, + advise: ::c_int) -> ::c_int; + } cfg_if! { diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index 83b4f0ba72caf8d5f7d874f15bb8e34b9a3eaa2c..5c682a92e79f8206586e9cc7699c285c765fc161 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -534,6 +534,13 @@ pub const SPLICE_F_GIFT: ::c_uint = 0x08; pub const RTLD_LOCAL: ::c_int = 0; +pub const POSIX_FADV_NORMAL: ::c_int = 0; +pub const POSIX_FADV_RANDOM: ::c_int = 1; +pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_FADV_WILLNEED: ::c_int = 3; +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + f! { pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let fd = fd as usize; @@ -642,6 +649,9 @@ extern { iov: *const ::iovec, nr_segs: ::size_t, flags: ::c_uint) -> ::ssize_t; + + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, + advise: ::c_int) -> ::c_int; } cfg_if! {