Merge branch 'sync_impl' into 'master'

sync implementation

See merge request redox-os/relibc!375
This commit is contained in:
Jeremy Soller
2023-04-26 18:24:48 +00:00
4 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -647,7 +647,7 @@ pub unsafe extern "C" fn symlink(path1: *const c_char, path2: *const c_char) ->
// #[no_mangle]
pub extern "C" fn sync() {
unimplemented!();
Sys::sync();
}
#[no_mangle]
+4
View File
@@ -480,6 +480,10 @@ impl Pal for Sys {
e(unsafe { syscall!(SYMLINKAT, path1.as_ptr(), AT_FDCWD, path2.as_ptr()) }) as c_int
}
fn sync() -> c_int {
e(unsafe { syscall!(SYNC) }) as c_int
}
fn umask(mask: mode_t) -> mode_t {
unsafe { syscall!(UMASK, mask) as mode_t }
}
+2
View File
@@ -177,6 +177,8 @@ pub trait Pal {
fn symlink(path1: &CStr, path2: &CStr) -> c_int;
fn sync() -> c_int;
fn umask(mask: mode_t) -> mode_t;
fn uname(utsname: *mut utsname) -> c_int;
+4
View File
@@ -832,6 +832,10 @@ impl Pal for Sys {
0
}
fn sync() -> c_int {
0
}
fn umask(mask: mode_t) -> mode_t {
e(syscall::umask(mask as usize)) as mode_t
}