Replace the Pausers' usage with Waiter/WaitQueue

This commit is contained in:
Chen Chengjun
2024-09-14 10:12:31 +08:00
committed by Tate, Hongliang Tian
parent 822caf34f4
commit 42e28763c5
12 changed files with 110 additions and 91 deletions

View File

@ -12,13 +12,13 @@ pub fn sys_waitid(
_infoq_addr: u64,
options: u64,
_rusage_addr: u64,
_ctx: &Context,
ctx: &Context,
) -> Result<SyscallReturn> {
// FIXME: what does infoq and rusage use for?
let process_filter = ProcessFilter::from_which_and_id(which, upid)?;
let wait_options = WaitOptions::from_bits(options as u32)
.ok_or(Error::with_message(Errno::EINVAL, "invalid options"))?;
let waited_process = wait_child_exit(process_filter, wait_options)?;
let waited_process = wait_child_exit(process_filter, wait_options, ctx)?;
let pid = waited_process.map_or(0, |process| process.pid());
Ok(SyscallReturn::Return(pid as _))
}