Add getsid stub

This commit is contained in:
Jeremy Soller
2022-10-17 11:37:11 -06:00
parent fc8e55abd8
commit b30c33adc3
4 changed files with 15 additions and 3 deletions
+2 -2
View File
@@ -402,9 +402,9 @@ pub extern "C" fn getppid() -> pid_t {
Sys::getppid()
}
// #[no_mangle]
#[no_mangle]
pub extern "C" fn getsid(pid: pid_t) -> pid_t {
unimplemented!();
Sys::getsid(pid)
}
#[no_mangle]
+4
View File
@@ -267,6 +267,10 @@ impl Pal for Sys {
e(syscall!(GETRLIMIT, resource, rlim)) as c_int
}
fn getsid(pid: pid_t) -> pid_t {
e(unsafe { syscall!(GETSID, pid) }) as pid_t
}
fn gettid() -> pid_t {
e(unsafe { syscall!(GETTID) }) as pid_t
}
+2
View File
@@ -100,6 +100,8 @@ pub trait Pal {
unsafe fn getrlimit(resource: c_int, rlim: *mut rlimit) -> c_int;
fn getsid(pid: pid_t) -> pid_t;
fn gettid() -> pid_t;
fn gettimeofday(tp: *mut timeval, tzp: *mut timezone) -> c_int;
+7 -1
View File
@@ -13,7 +13,7 @@ use crate::{
fs::File,
header::{
dirent::dirent,
errno::{EINVAL, EIO, ENOMEM, EPERM, ERANGE},
errno::{EINVAL, EIO, ENOMEM, ENOSYS, EPERM, ERANGE},
fcntl,
string::strlen,
sys_mman::{MAP_ANONYMOUS, PROT_READ, PROT_WRITE},
@@ -533,6 +533,12 @@ impl Pal for Sys {
0
}
fn getsid(pid: pid_t) -> pid_t {
//TODO
unsafe { errno = ENOSYS };
-1
}
fn gettid() -> pid_t {
//TODO
Self::getpid()