sys_wait4

Function sys_wait4 

Source
pub fn sys_wait4(
    locked: &mut Locked<Unlocked>,
    current_task: &CurrentTask,
    raw_selector: pid_t,
    user_wstatus: UserRef<i32>,
    options: u32,
    user_rusage: RUsagePtr,
) -> Result<pid_t, Errno>
Expand description

The wait4 syscall waits for a child process to change state.

§Args

  • raw_selector: The PID of the process to wait for. See wait4(2) for more details.
  • user_wstatus: A pointer to an integer that will be filled with the exit status of the process.
  • options: A bitmask of flags that control the behavior of the syscall.
  • user_rusage: An optional pointer to a rusage structure that will be filled with resource usage information.

§Returns

On success, returns the PID of the process that changed state, or 0 if WNOHANG was specified and no child has changed state. On error, returns an Errno.