1 // The functions replacing the C macros use the same names as in libc. 2 #![allow(non_snake_case)] 3 4 pub(crate) use linux_raw_sys::general::{WCONTINUED, WNOHANG, WUNTRACED}; 5 6 #[inline] WIFSTOPPED(status: u32) -> bool7pub(crate) fn WIFSTOPPED(status: u32) -> bool { 8 (status & 0xff) == 0x7f 9 } 10 11 #[inline] WSTOPSIG(status: u32) -> u3212pub(crate) fn WSTOPSIG(status: u32) -> u32 { 13 (status >> 8) & 0xff 14 } 15 16 #[inline] WIFCONTINUED(status: u32) -> bool17pub(crate) fn WIFCONTINUED(status: u32) -> bool { 18 status == 0xffff 19 } 20 21 #[inline] WIFSIGNALED(status: u32) -> bool22pub(crate) fn WIFSIGNALED(status: u32) -> bool { 23 ((status & 0x7f) + 1) as i8 >= 2 24 } 25 26 #[inline] WTERMSIG(status: u32) -> u3227pub(crate) fn WTERMSIG(status: u32) -> u32 { 28 status & 0x7f 29 } 30 31 #[inline] WIFEXITED(status: u32) -> bool32pub(crate) fn WIFEXITED(status: u32) -> bool { 33 (status & 0x7f) == 0 34 } 35 36 #[inline] WEXITSTATUS(status: u32) -> u3237pub(crate) fn WEXITSTATUS(status: u32) -> u32 { 38 (status >> 8) & 0xff 39 } 40