Merge branch 'fdatasync_impl' into 'master'
unistd: fdatasync implementation. See merge request redox-os/relibc!373
This commit is contained in:
@@ -223,7 +223,7 @@ pub extern "C" fn fchdir(fildes: c_int) -> c_int {
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn fdatasync(fildes: c_int) -> c_int {
|
||||
unimplemented!();
|
||||
Sys::fdatasync(fildes)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
@@ -145,6 +145,10 @@ impl Pal for Sys {
|
||||
e(unsafe { syscall!(FCHOWN, fildes, owner, group) }) as c_int
|
||||
}
|
||||
|
||||
fn fdatasync(fildes: c_int) -> c_int {
|
||||
e(unsafe { syscall!(FDATASYNC, fildes) }) as c_int
|
||||
}
|
||||
|
||||
fn flock(fd: c_int, operation: c_int) -> c_int {
|
||||
e(unsafe { syscall!(FLOCK, fd, operation) }) as c_int
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ pub trait Pal {
|
||||
|
||||
fn fchown(fildes: c_int, owner: uid_t, group: gid_t) -> c_int;
|
||||
|
||||
fn fdatasync(fildes: c_int) -> c_int;
|
||||
|
||||
fn flock(fd: c_int, operation: c_int) -> c_int;
|
||||
|
||||
fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
|
||||
@@ -251,6 +251,11 @@ impl Pal for Sys {
|
||||
e(syscall::fcntl(fd as usize, cmd as usize, args as usize)) as c_int
|
||||
}
|
||||
|
||||
fn fdatasync(fd: c_int) -> c_int {
|
||||
// TODO: "Needs" syscall update
|
||||
e(syscall::fsync(fd as usize)) as c_int
|
||||
}
|
||||
|
||||
fn flock(_fd: c_int, _operation: c_int) -> c_int {
|
||||
// TODO: Redox does not have file locking yet
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user