Merge branch 'eintr-exit' into 'master'

Handle EINTR in posix_exit

See merge request redox-os/relibc!1488
This commit is contained in:
Mathew John Roberts
2026-06-23 06:38:43 +01:00
+12 -6
View File
@@ -424,12 +424,18 @@ pub fn get_proc_credentials(cap_fd: usize, target_pid: usize, buf: &mut [u8]) ->
)
}
pub fn posix_exit(status: i32) -> ! {
this_proc_call(
&mut [],
CallFlags::empty(),
&[ProcCall::Exit as u64, (status & 0xFF) as u64],
)
.expect("failed to call proc mgr with Exit");
// TODO: probably not correct place to handle EINTR
loop {
match this_proc_call(
&mut [],
CallFlags::empty(),
&[ProcCall::Exit as u64, (status & 0xFF) as u64],
) {
Ok(_) => break,
Err(Error { errno: EINTR }) => continue,
Err(e) => panic!("failed to call proc mgr with Exit: {e}"),
}
}
let _ = syscall::write(1, b"redox-rt: ProcCall::Exit FAILED, abort()ing!\n");
core::intrinsics::abort();
}