Merge branch 'setsid__impl' into 'master'

setsid implementation

See merge request redox-os/relibc!381
This commit is contained in:
Jeremy Soller
2023-05-04 21:38:40 +00:00
4 changed files with 14 additions and 2 deletions
+2 -2
View File
@@ -601,9 +601,9 @@ pub extern "C" fn setreuid(ruid: uid_t, euid: uid_t) -> c_int {
Sys::setreuid(ruid, euid)
}
// #[no_mangle]
#[no_mangle]
pub extern "C" fn setsid() -> pid_t {
unimplemented!();
Sys::setsid()
}
#[no_mangle]
+4
View File
@@ -476,6 +476,10 @@ impl Pal for Sys {
e(unsafe { syscall!(SETREUID, ruid, euid) }) as c_int
}
fn setsid() -> c_int {
e(unsafe { syscall!(SETSID) }) as c_int
}
fn symlink(path1: &CStr, path2: &CStr) -> c_int {
e(unsafe { syscall!(SYMLINKAT, path1.as_ptr(), AT_FDCWD, path2.as_ptr()) }) as c_int
}
+2
View File
@@ -175,6 +175,8 @@ pub trait Pal {
fn setreuid(ruid: uid_t, euid: uid_t) -> c_int;
fn setsid() -> c_int;
fn symlink(path1: &CStr, path2: &CStr) -> c_int;
fn sync() -> c_int;
+6
View File
@@ -807,6 +807,12 @@ impl Pal for Sys {
-1
}
fn setsid() -> c_int {
// TODO
unsafe { errno = ENOSYS };
-1
}
fn setregid(rgid: gid_t, egid: gid_t) -> c_int {
e(syscall::setregid(rgid as usize, egid as usize)) as c_int
}