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

Add PidFd::{kill, wait, try_wait} #124101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Apr 17, 2024

#117957 changed Child kill/wait/try_wait to use its pidfd instead of the pid, when one is available.
This PR extracts those implementations and makes them available on PidFd directly.

The PidFd implementations differs significantly from the corresponding Child methods:

  • the methods can be called after the child has been reaped, which will result in an error but will be safe. This state is not observable in Child unless something stole the zombie child
  • the ExitStatus is not kept, meaning that only the first time a wait succeeds it will be returned
  • wait does not close stdin
  • wait only requires &self instead of &mut self since there is no state to maintain and subsequent calls are safe

Tracking issue: #82971

@rustbot
Copy link
Collaborator

rustbot commented Apr 17, 2024

r? @cuviper

rustbot has assigned @cuviper.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-linux Operating system: Linux O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-linux Operating system: Linux O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants