Add fstatvfs syscall

This commit is contained in:
Jeremy Soller
2016-11-18 08:14:52 -07:00
parent d84ebc61b1
commit cc90408d14
2 changed files with 7 additions and 2 deletions

View File

@@ -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 <jackpot51@gmail.com>"]

View File

@@ -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<usize> {
unsafe { syscall3(SYS_FSTAT, fd, stat as *mut Stat as usize, mem::size_of::<Stat>()) }
}
/// Get metadata about a filesystem
pub fn fstatvfs(fd: usize, stat: &mut StatVfs) -> Result<usize> {
unsafe { syscall3(SYS_FSTATVFS, fd, stat as *mut StatVfs as usize, mem::size_of::<StatVfs>()) }
}
/// Sync a file descriptor to its underlying medium
pub fn fsync(fd: usize) -> Result<usize> {
unsafe { syscall1(SYS_FSYNC, fd) }