rustix
rustix copied to clipboard
waitpgid discards valuable information
As per its source:
pub fn waitpgid(pgid: Pid, waitopts: WaitOptions) -> Result<Option<WaitStatus>> {
Ok(syscalls::waitpgid(pgid, waitopts)?.map(|(_, status)| status))
}
The first return value is the PID of the process that was actually awaited, which may be any process in the group. That's valuable to be able to wait for an entire process group and retrieve the exitstatus of the correct process (generally the group leader) regardless of exit order.