Pass si_pid to all realtime signals.
This commit is contained in:
+5
-3
@@ -283,15 +283,17 @@ pub fn get_auxv(auxvs: &[[usize; 2]], key: usize) -> Option<usize> {
|
||||
|
||||
#[cold]
|
||||
#[cfg(target_os = "redox")]
|
||||
pub fn init(auxvs: Box<[[usize; 2]]>) {
|
||||
// SAFETY: Must only be called when only one thread exists.
|
||||
pub unsafe fn init(auxvs: Box<[[usize; 2]]>) {
|
||||
redox_rt::initialize();
|
||||
|
||||
use self::auxv_defs::*;
|
||||
|
||||
if let (Some(cwd_ptr), Some(cwd_len)) = (
|
||||
get_auxv(&auxvs, AT_REDOX_INITIAL_CWD_PTR),
|
||||
get_auxv(&auxvs, AT_REDOX_INITIAL_CWD_LEN),
|
||||
) {
|
||||
let cwd_bytes: &'static [u8] =
|
||||
unsafe { core::slice::from_raw_parts(cwd_ptr as *const u8, cwd_len) };
|
||||
let cwd_bytes: &'static [u8] = core::slice::from_raw_parts(cwd_ptr as *const u8, cwd_len);
|
||||
if let Ok(cwd) = core::str::from_utf8(cwd_bytes) {
|
||||
self::sys::path::set_cwd_manual(cwd.into());
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ impl Pal for Sys {
|
||||
}
|
||||
|
||||
fn getpid() -> pid_t {
|
||||
e(syscall::getpid()) as pid_t
|
||||
redox_rt::sys::posix_getpid() as pid_t
|
||||
}
|
||||
|
||||
fn getppid() -> pid_t {
|
||||
|
||||
@@ -39,6 +39,7 @@ pub struct ucontext_t {
|
||||
}
|
||||
|
||||
const _: () = {
|
||||
#[track_caller]
|
||||
const fn assert_eq(a: usize, b: usize) {
|
||||
if a != b {
|
||||
panic!("compile-time struct verification failed");
|
||||
|
||||
Reference in New Issue
Block a user