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 {
100100 /// one passed to it also.
101101 pub unsafe fn end_ffi (
102102 mut sv_guard : std:: sync:: MutexGuard < ' static , Option < Supervisor > > ,
103- _alloc : Rc < RefCell < IsolatedAlloc > > ,
103+ alloc : Rc < RefCell < IsolatedAlloc > > ,
104104 raw_stack_ptr : Option < * mut [ u8 ; FAKE_STACK_SIZE ] > ,
105105 ) -> Option < MemEvents > {
106106 // 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> {
228228 // SAFETY: prctl PR_SET_PDEATHSIG is always safe to call.
229229 let ret = libc:: prctl ( libc:: PR_SET_PDEATHSIG , libc:: SIGTERM ) ;
230230 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+ ) ;
231237 // First make sure the parent succeeded with ptracing us!
232238 signal:: raise ( signal:: SIGSTOP ) . unwrap ( ) ;
233239 // If we're the child process, save the supervisor info.
You can’t perform that action at this time.
0 commit comments