Function waitid

fn waitid(id: Id<'_>, flags: WaitPidFlag) -> Result<WaitStatus>

Wait for a process to change status

See also waitid(2)