Function nc::syncfs[][src]

pub fn syncfs(fd: i32) -> Result<(), Errno>
Expand description

Commit filesystem cache related to fd to disk.

let path = "/etc/passwd";
let ret = nc::openat(nc::AT_FDCWD, path, nc::O_RDONLY, 0);
assert!(ret.is_ok());
let fd = ret.unwrap();
let ret = nc::syncfs(fd);
assert!(ret.is_ok());
assert!(nc::close(fd).is_ok());