devela::_dep::nc

Function statfs

pub unsafe fn statfs<P>(filename: P, buf: &mut statfs_t) -> Result<(), i32> 
where P: AsRef<Path>,
Available on crate feature dep_nc only.
Expand description

Get filesystem statistics.

§Examples

let path = "/usr";
let mut statfs = nc::statfs_t::default();
let ret = unsafe { nc::statfs(path, &mut statfs) };
assert!(ret.is_ok());
assert!(statfs.f_bfree > 0);
assert!(statfs.f_bavail > 0);