summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/imp/linux_raw/process/wait.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /vendor/rustix/src/imp/linux_raw/process/wait.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/imp/linux_raw/process/wait.rs')
-rw-r--r--vendor/rustix/src/imp/linux_raw/process/wait.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/rustix/src/imp/linux_raw/process/wait.rs b/vendor/rustix/src/imp/linux_raw/process/wait.rs
new file mode 100644
index 000000000..701b4ac0c
--- /dev/null
+++ b/vendor/rustix/src/imp/linux_raw/process/wait.rs
@@ -0,0 +1,39 @@
+// The functions replacing the C macros use the same names as in libc.
+#![allow(non_snake_case)]
+
+pub(crate) use linux_raw_sys::general::{WCONTINUED, WNOHANG, WUNTRACED};
+
+#[inline]
+pub(crate) fn WIFSTOPPED(status: u32) -> bool {
+ (status & 0xff) == 0x7f
+}
+
+#[inline]
+pub(crate) fn WSTOPSIG(status: u32) -> u32 {
+ (status >> 8) & 0xff
+}
+
+#[inline]
+pub(crate) fn WIFCONTINUED(status: u32) -> bool {
+ status == 0xffff
+}
+
+#[inline]
+pub(crate) fn WIFSIGNALED(status: u32) -> bool {
+ ((status & 0x7f) + 1) as i8 >= 2
+}
+
+#[inline]
+pub(crate) fn WTERMSIG(status: u32) -> u32 {
+ status & 0x7f
+}
+
+#[inline]
+pub(crate) fn WIFEXITED(status: u32) -> bool {
+ (status & 0x7f) == 0
+}
+
+#[inline]
+pub(crate) fn WEXITSTATUS(status: u32) -> u32 {
+ (status >> 8) & 0xff
+}