Pass si_pid to all realtime signals.
This commit is contained in:
+4
-1
@@ -141,6 +141,7 @@ fn resolve_path_name(
|
||||
}
|
||||
None
|
||||
}
|
||||
// TODO: Make unsafe
|
||||
#[no_mangle]
|
||||
pub extern "C" fn relibc_ld_so_start(sp: &'static mut Stack, ld_entry: usize) -> usize {
|
||||
// We get the arguments, the environment, and the auxilary vector
|
||||
@@ -184,7 +185,9 @@ pub extern "C" fn relibc_ld_so_start(sp: &'static mut Stack, ld_entry: usize) ->
|
||||
}
|
||||
|
||||
// TODO: Fix memory leak, although minimal.
|
||||
crate::platform::init(auxv.clone());
|
||||
unsafe {
|
||||
crate::platform::init(auxv.clone());
|
||||
}
|
||||
|
||||
// Some variables that will be overridden by environment and auxiliary vectors
|
||||
let ld_library_path = envs.get("LD_LIBRARY_PATH").map(|s| s.to_owned());
|
||||
|
||||
+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