Skip to content

Commit

Permalink
Auto merge of #124101 - the8472:pidfd-methods, r=cuviper
Browse files Browse the repository at this point in the history
Add PidFd::{kill, wait, try_wait}

#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 differ 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
  • Loading branch information
bors committed Jun 22, 2024
2 parents 31a98c7 + 400a29d commit d326732
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit d326732

Please sign in to comment.