File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl Supervisor {
100
100
/// one passed to it also.
101
101
pub unsafe fn end_ffi (
102
102
mut sv_guard : std:: sync:: MutexGuard < ' static , Option < Supervisor > > ,
103
- _alloc : Rc < RefCell < IsolatedAlloc > > ,
103
+ alloc : Rc < RefCell < IsolatedAlloc > > ,
104
104
raw_stack_ptr : Option < * mut [ u8 ; FAKE_STACK_SIZE ] > ,
105
105
) -> Option < MemEvents > {
106
106
// We can't use IPC channels here to signal that FFI mode has ended,
@@ -228,6 +228,12 @@ pub unsafe fn init_sv() -> Result<(), SvInitError> {
228
228
// SAFETY: prctl PR_SET_PDEATHSIG is always safe to call.
229
229
let ret = libc:: prctl ( libc:: PR_SET_PDEATHSIG , libc:: SIGTERM ) ;
230
230
assert_eq ! ( ret, 0 ) ;
231
+ // Set up the pagesize used in the memory protection functions.
232
+ // SAFETY: sysconf(_SC_PAGESIZE) is always safe and doesn't error
233
+ super :: parent:: PAGE_SIZE . store (
234
+ libc:: sysconf ( libc:: _SC_PAGESIZE) . try_into ( ) . unwrap ( ) ,
235
+ std:: sync:: atomic:: Ordering :: Relaxed ,
236
+ ) ;
231
237
// First make sure the parent succeeded with ptracing us!
232
238
signal:: raise ( signal:: SIGSTOP ) . unwrap ( ) ;
233
239
// If we're the child process, save the supervisor info.
You can’t perform that action at this time.
0 commit comments