Reach init fork
This commit is contained in:
+12
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
use alloc::{boxed::Box, vec::Vec};
|
||||
use core::{intrinsics, ptr};
|
||||
use generic_rt::ExpectTlsFree;
|
||||
|
||||
use crate::{
|
||||
header::{libgen, stdio, stdlib},
|
||||
@@ -141,8 +142,18 @@ pub unsafe extern "C" fn relibc_start(sp: &'static Stack) -> ! {
|
||||
// Ensure correct host system before executing more system calls
|
||||
relibc_verify_host();
|
||||
|
||||
#[cfg(target_os = "redox")]
|
||||
let thr_fd = redox_rt::proc::FdGuard::new(
|
||||
crate::platform::get_auxv_raw(sp.auxv().cast(), redox_rt::auxv_defs::AT_REDOX_THR_FD)
|
||||
.expect_notls("no thread fd present"),
|
||||
);
|
||||
|
||||
// Initialize TLS, if necessary
|
||||
ld_so::init(sp);
|
||||
ld_so::init(
|
||||
sp,
|
||||
#[cfg(target_os = "redox")]
|
||||
thr_fd,
|
||||
);
|
||||
|
||||
// Set up the right allocator...
|
||||
// if any memory rust based memory allocation happen before this step .. we are doomed.
|
||||
|
||||
Reference in New Issue
Block a user