Merge branch 'fdatasync_impl' into 'master'

unistd: fdatasync implementation.

See merge request redox-os/relibc!373
This commit is contained in:
Jeremy Soller
2023-04-26 18:22:57 +00:00
4 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -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]
+4
View File
@@ -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
}
+2
View File
@@ -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;
+5
View File
@@ -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