Skip to content
Snippets Groups Projects
Verified Commit 17cb7482 authored by Jacob Lorentzon's avatar Jacob Lorentzon :speech_balloon:
Browse files

Implement syscall restart for waitpid.

parent 4c20a9ab
No related branches found
No related tags found
1 merge request!483Implement syscall restart
......@@ -76,3 +76,13 @@ pub unsafe fn sys_futex_wake(addr: *mut u32, num: u32) -> Result<u32> {
)
.map(|awoken| awoken as u32)
}
pub fn sys_waitpid(pid: usize, status: &mut usize, flags: usize) -> Result<usize> {
wrapper(|| {
syscall::waitpid(
pid,
status,
syscall::WaitFlags::from_bits(flags)
.expect("waitpid: invalid bit pattern"),
)
})
}
......@@ -1058,12 +1058,7 @@ impl Pal for Sys {
let mut status = 0;
let inner = |status: &mut usize, flags| {
syscall::waitpid(
pid as usize,
status,
syscall::WaitFlags::from_bits(flags as usize)
.expect("waitpid: invalid bit pattern"),
)
redox_rt::sys::sys_waitpid(pid as usize, status, flags as usize)
};
// First, allow ptrace to handle waitpid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment