summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/process/wait.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/process/wait.rs')
-rw-r--r--vendor/rustix/src/process/wait.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/vendor/rustix/src/process/wait.rs b/vendor/rustix/src/process/wait.rs
index ea2691ae1..d46c96005 100644
--- a/vendor/rustix/src/process/wait.rs
+++ b/vendor/rustix/src/process/wait.rs
@@ -10,34 +10,38 @@ use crate::backend::process::wait::SiginfoExt;
bitflags! {
/// Options for modifying the behavior of wait/waitpid
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct WaitOptions: u32 {
/// Return immediately if no child has exited.
- const NOHANG = backend::process::wait::WNOHANG as _;
+ const NOHANG = bitcast!(backend::process::wait::WNOHANG);
/// Return if a child has stopped (but not traced via [`ptrace`])
///
/// [`ptrace`]: https://man7.org/linux/man-pages/man2/ptrace.2.html
- const UNTRACED = backend::process::wait::WUNTRACED as _;
+ const UNTRACED = bitcast!(backend::process::wait::WUNTRACED);
/// Return if a stopped child has been resumed by delivery of
/// [`Signal::Cont`].
- const CONTINUED = backend::process::wait::WCONTINUED as _;
+ const CONTINUED = bitcast!(backend::process::wait::WCONTINUED);
}
}
#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
bitflags! {
/// Options for modifying the behavior of waitid
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct WaitidOptions: u32 {
/// Return immediately if no child has exited.
- const NOHANG = backend::process::wait::WNOHANG as _;
+ const NOHANG = bitcast!(backend::process::wait::WNOHANG);
/// Return if a stopped child has been resumed by delivery of
/// [`Signal::Cont`]
- const CONTINUED = backend::process::wait::WCONTINUED as _;
+ const CONTINUED = bitcast!(backend::process::wait::WCONTINUED);
/// Wait for processed that have exited.
- const EXITED = backend::process::wait::WEXITED as _;
+ const EXITED = bitcast!(backend::process::wait::WEXITED);
/// Keep processed in a waitable state.
- const NOWAIT = backend::process::wait::WNOWAIT as _;
+ const NOWAIT = bitcast!(backend::process::wait::WNOWAIT);
/// Wait for processes that have been stopped.
- const STOPPED = backend::process::wait::WSTOPPED as _;
+ const STOPPED = bitcast!(backend::process::wait::WSTOPPED);
}
}
@@ -230,8 +234,8 @@ impl WaitidStatus {
#[cfg(not(any(target_os = "netbsd", target_os = "fuchsia", target_os = "emscripten")))]
#[allow(unsafe_code)]
fn si_status(&self) -> backend::c::c_int {
- // SAFETY: POSIX [specifies] that the `siginfo_t` returned by a `waitid`
- // call always has a valid `si_status` value.
+ // SAFETY: POSIX [specifies] that the `siginfo_t` returned by a
+ // `waitid` call always has a valid `si_status` value.
//
// [specifies]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
unsafe { self.0.si_status() }
@@ -256,7 +260,7 @@ pub enum WaitId<'a> {
/// Eat the lifetime for non-Linux platforms.
#[doc(hidden)]
#[cfg(not(target_os = "linux"))]
- __EatLifetime(std::marker::PhantomData<&'a ()>),
+ __EatLifetime(core::marker::PhantomData<&'a ()>),
// TODO(notgull): Once this crate has the concept of PGIDs, add a WaitId::Pgid
}