Add getsid stub
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user