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

waitpid doesn't returned pid #989

Open
SUPERCILEX opened this issue Jan 14, 2024 · 4 comments
Open

waitpid doesn't returned pid #989

SUPERCILEX opened this issue Jan 14, 2024 · 4 comments

Comments

@SUPERCILEX
Copy link
Contributor

Is there a reason for this? It should return a (Pid, WaitStatus) so you can spawn multiple processes in parallel and wait for them to finish in any order while performing specific actions on a process' completion.

@SUPERCILEX
Copy link
Contributor Author

wait kind of counts, but doesn't have the same semantics because it will wait for any children rather than just the ones in the same process group.

@sunfishcode
Copy link
Member

No, this appears to just be an oversight. The original waitpid API in rustix didn't support waiting on process groups so the pid return value was redundant, but it now does support waiting in process groups, so it should return the pid.

@SUPERCILEX
Copy link
Contributor Author

Cool! Should I submit a PR or does this go into the 1.0 issue? Not sure how you're managing breaking changes...

@sunfishcode
Copy link
Member

You can submit breaking changes to the 1.0-staging branch. I'm going to start working toward a 1.0 release in order to fix #917 / #990, though there are a few things to do, so I don't yet have a timeline in mind.

If you'd like to do something that could be released sooner, we could add a new function named something like waitpid_pid or so, which returns the pid.

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

2 participants