diff --git a/Cargo.toml b/Cargo.toml index 4418633..972bdb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_syscall" -version = "0.1.8" +version = "0.1.9" description = "A Rust library to access raw Redox system calls" license = "MIT" authors = ["Jeremy Soller "] diff --git a/src/call.rs b/src/call.rs index c75fd9f..5f2508f 100644 --- a/src/call.rs +++ b/src/call.rs @@ -1,5 +1,5 @@ use super::arch::*; -use super::data::{Stat, TimeSpec}; +use super::data::{Stat, StatVfs, TimeSpec}; use super::error::Result; use super::number::*; @@ -101,6 +101,11 @@ pub fn fstat(fd: usize, stat: &mut Stat) -> Result { unsafe { syscall3(SYS_FSTAT, fd, stat as *mut Stat as usize, mem::size_of::()) } } +/// Get metadata about a filesystem +pub fn fstatvfs(fd: usize, stat: &mut StatVfs) -> Result { + unsafe { syscall3(SYS_FSTATVFS, fd, stat as *mut StatVfs as usize, mem::size_of::()) } +} + /// Sync a file descriptor to its underlying medium pub fn fsync(fd: usize) -> Result { unsafe { syscall1(SYS_FSYNC, fd) }