Skip to main content

try_wait4_pid

Function try_wait4_pid 

Source
pub fn try_wait4_pid(pid: u32) -> Result<Option<ResUse>>
Expand description

Non-blocking wait4 for a child pid of this process.

Ok(None) means the child is still running. Once Ok(Some(_)) is returned the pid has been reaped: do not wait, wait4, try_wait4, try_wait4_pid, or send it a signal (e.g. kill) again. The pid may already have been recycled by the OS onto an unrelated process.

pid must identify a specific child of this process; 0 is rejected rather than silently waiting for any child in this process’s process group, which is what wait4(2) does with a pid of 0.