devela::_dep::nc::call

Function fadvise64

pub unsafe fn fadvise64(
    fd: i32,
    offset: i64,
    len: usize,
    advice: i32,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Predeclare an access pattern for file data.

§Examples

let path = "/etc/passwd";
let ret = unsafe { nc::openat(nc::AT_FDCWD, path, nc::O_RDONLY, 0) };
assert!(ret.is_ok());
let fd = ret.unwrap();
let ret = unsafe { nc::fadvise64(fd, 0, 1024, nc::POSIX_FADV_NORMAL) };
assert!(ret.is_ok());
let ret = unsafe { nc::close(fd) };
assert!(ret.is_ok());