Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

waitpgid discards valuable information #1033

Open
passcod opened this issue Mar 9, 2024 · 0 comments
Open

waitpgid discards valuable information #1033

passcod opened this issue Mar 9, 2024 · 0 comments

Comments

@passcod
Copy link

passcod commented Mar 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant