pub fn waitpid(
    pid: Option<Pid>,
    waitopts: WaitOptions
) -> Result<Option<WaitStatus>>
Expand description

waitpid(pid, waitopts)—Wait for a specific process to change state.

If the pid is None, the call will wait for any child process whose process group id matches that of the calling process.

If the pid is equal to RawPid::MAX, the call will wait for any child process.

Otherwise if the wrapping_neg of pid is less than pid, the call will wait for any child process with a group ID equal to the wrapping_neg of pid.

Otherwise, the call will wait for the child process with the given pid.

On Success, returns the status of the selected process.

If NOHANG was specified in the options, and the selected child process didn’t change state, returns None.

References