Implement exit_this_thread on Redox.

This commit is contained in:
4lDO2
2024-07-15 14:01:09 +02:00
parent c286dd6d33
commit 4cb6644181
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -47,3 +47,11 @@ pub unsafe fn rlct_clone_impl(stack: *mut usize) -> Result<FdGuard> {
Ok(new_thr_fd)
}
pub fn exit_this_thread() -> ! {
let thread_fd = RtTcb::current().thread_fd();
// TODO: modify interface so it writes directly to the thread fd?
let status_fd = syscall::dup(**thread_fd, b"status").unwrap();
syscall::write(status_fd, &0_usize.to_ne_bytes()).unwrap();
unreachable!()
}
+1 -1
View File
@@ -1138,6 +1138,6 @@ impl Pal for Sys {
}
fn exit_thread() -> ! {
Self::exit(0)
redox_rt::thread::exit_this_thread()
}
}