Merge branch 'setsid__impl' into 'master'
setsid implementation See merge request redox-os/relibc!381
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user