From 437786f6a1ed848287c9bcc5b4f89e68e2771987 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Wed, 10 Sep 2025 15:10:06 +0200 Subject: [PATCH] Restrict posix_exit to & 0xFF to fix EINVAL panic. --- redox-rt/src/sys.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redox-rt/src/sys.rs b/redox-rt/src/sys.rs index 07b06f745d..3e022e76ba 100644 --- a/redox-rt/src/sys.rs +++ b/redox-rt/src/sys.rs @@ -324,7 +324,7 @@ pub fn posix_exit(status: i32) -> ! { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Exit as u64, status as u64], + &[ProcCall::Exit as u64, (status & 0xFF) as u64], ) .expect("failed to call proc mgr with Exit"); let _ = syscall::write(1, b"redox-rt: ProcCall::Exit FAILED, abort()ing!\n");