Pass si_pid to all realtime signals.

This commit is contained in:
4lDO2
2024-08-01 19:51:30 +02:00
parent 6fe7c264f6
commit f6761407e5
9 changed files with 64 additions and 31 deletions
+5 -3
View File
@@ -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());
}
+1 -1
View File
@@ -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 {
+1
View File
@@ -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");