-
Notifications
You must be signed in to change notification settings - Fork 196
Expand waitid support, add waitid tests #590
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
Conversation
wow, |
11d8d40
to
40a9bb2
Compare
Oofff okay, now it builds everywhere and isn't actually too bad, tho some |
@@ -426,7 +426,7 @@ pub(crate) fn waitid(id: WaitId<'_>, options: WaitidOptions) -> io::Result<Optio | |||
#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))] | |||
#[inline] | |||
fn _waitid_all(options: WaitidOptions) -> io::Result<Option<WaitidStatus>> { | |||
let mut status = MaybeUninit::<c::siginfo_t>::uninit(); | |||
let mut status = MaybeUninit::<c::siginfo_t>::zeroed(); |
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.
Is the reason for explicit zeroing here the comment in the Linux man page about zeroing out the si_pid
field? If so, could you quote that documentation here, so that it's recorded in the code why this uses zeroed memory?
&self.0 | ||
} | ||
|
||
#[cfg(linux_raw)] |
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.
Rustix does have a few places where the public API for linux_raw
differs from the public API for the libc backend on Linux, but we're working on eliminating them, as it makes code less portable. Is it complicated to add Linux support using the libc backend as well? Also, yeah, your suggestion to push these details into src/backend/* sounds good; perhaps in new src/backend/*/wait.rs files?
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.
It should already work with the libc backend (CI should test this, right?) — it's the final not(any(…))
version. The libc crate does make an effort to offer the same interface here on all platforms, just lacking in a few places such as rust-lang/libc#3185 and OpenBSD/NetBSD currently.
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.
Ah, I see now. I was confused by the cfg
s :-).
6e3faad
to
7155d9c
Compare
Okay, now it looks decent I guess… |
Cool, thanks! |
Thanks for this change. I was just looking for the missing waitidstatus methods! 🎉 |
This is now released in rustix 0.37.8. |
WaitidStatus
Copy
onWaitidStatus
? Technically an API break that should go to 0.38 release planning #578? ButWaitidStatus
was currently completely unusable with nothing on it…