-
Notifications
You must be signed in to change notification settings - Fork 682
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
wait: implement waitid() #1584
wait: implement waitid() #1584
Conversation
293f405
to
095b08a
Compare
197652a
to
ad72c47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget a CHANGELOG entry too
/// Wait for a process to change status | ||
/// | ||
/// See also [waitid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html) | ||
#[cfg(any( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libc defines this function for almost all OSes. I think it might be everything except Redox. Any reason not to enable it for all of them in Nix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started with the list of platforms for which WEXITED
is defined in WaitPidFlag
and then removed all that had some obvious issue:
- NetBSD has broken siginfo_t in libc (see issue linked in PR description)
- Apple/IOS are missing CLD_EXITED/KILLED/DUMPED in libc (and I don't really want to open another libc PR for a system that I do not use and that I'm not familiar with...)
@NeoRaider can you rebase this? It isn't conflicting on GitHub, but local testing shows the changelog will merge into the |
Rebased and updated commit message to reflect the current status of the mentioned qemu-user issue. |
Hmm, seems I'll have to update the test code as well. |
5c83b03
to
80de838
Compare
bors r+ |
Merge conflict. |
Another PR went in first and modified the changelog in the same spot. Can you rebase? |
waitid() has a number of additional features that waitpid() is missing: - WNOWAIT is only accepted for waitid() on Linux (and possibly other platforms) - Support for waiting on PID file descriptors on Linux For now support is added for all platforms with waitid() that have proper siginfo_t support in libc. NetBSD support is currently a work in progress [1]. Tests for the signal/exit code are currently skipped on MIPS platforms due to bugs in qemu-user's translation of siginfo_t (fixed in [2] and [3]; the second fix is not in a released qemu version yet). [1] rust-lang/libc#2476 [2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html [3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
bors r+ |
waitid() has a number of additional features that waitpid() is missing:
For now support is added for all platforms with waitid() that have proper siginfo_t support in libc. NetBSD support is currently a work in progress [1].
Tests for the signal/exit code are currently skipped on MIPS platforms due to multiple bugs in qemu-user in the translation of siginfo_t (one fixed in January [2], one currently under review [3]).
[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html