@@ -3158,42 +3158,6 @@ f! {
31583158 }
31593159 }
31603160
3161- pub fn WIFSTOPPED ( status: :: c_int) -> bool {
3162- ( status & 0xff ) == 0x7f
3163- }
3164-
3165- pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
3166- ( status >> 8 ) & 0xff
3167- }
3168-
3169- pub fn WIFCONTINUED ( status: :: c_int) -> bool {
3170- status == 0xffff
3171- }
3172-
3173- pub fn WIFSIGNALED ( status: :: c_int) -> bool {
3174- ( ( status & 0x7f ) + 1 ) as i8 >= 2
3175- }
3176-
3177- pub fn WTERMSIG ( status: :: c_int) -> :: c_int {
3178- status & 0x7f
3179- }
3180-
3181- pub fn WIFEXITED ( status: :: c_int) -> bool {
3182- ( status & 0x7f ) == 0
3183- }
3184-
3185- pub fn WEXITSTATUS ( status: :: c_int) -> :: c_int {
3186- ( status >> 8 ) & 0xff
3187- }
3188-
3189- pub fn WCOREDUMP ( status: :: c_int) -> bool {
3190- ( status & 0x80 ) != 0
3191- }
3192-
3193- pub fn QCMD ( cmd: :: c_int, type_: :: c_int) -> :: c_int {
3194- ( cmd << 8 ) | ( type_ & 0x00ff )
3195- }
3196-
31973161 pub fn CPU_ZERO ( cpuset: & mut cpu_set_t) -> ( ) {
31983162 for slot in cpuset. bits. iter_mut( ) {
31993163 * slot = 0 ;
@@ -3291,6 +3255,44 @@ f! {
32913255 }
32923256}
32933257
3258+ safe_f ! {
3259+ pub { const } fn WIFSTOPPED ( status: :: c_int) -> bool {
3260+ ( status & 0xff ) == 0x7f
3261+ }
3262+
3263+ pub { const } fn WSTOPSIG ( status: :: c_int) -> :: c_int {
3264+ ( status >> 8 ) & 0xff
3265+ }
3266+
3267+ pub { const } fn WIFCONTINUED ( status: :: c_int) -> bool {
3268+ status == 0xffff
3269+ }
3270+
3271+ pub { const } fn WIFSIGNALED ( status: :: c_int) -> bool {
3272+ ( ( status & 0x7f ) + 1 ) as i8 >= 2
3273+ }
3274+
3275+ pub { const } fn WTERMSIG ( status: :: c_int) -> :: c_int {
3276+ status & 0x7f
3277+ }
3278+
3279+ pub { const } fn WIFEXITED ( status: :: c_int) -> bool {
3280+ ( status & 0x7f ) == 0
3281+ }
3282+
3283+ pub { const } fn WEXITSTATUS ( status: :: c_int) -> :: c_int {
3284+ ( status >> 8 ) & 0xff
3285+ }
3286+
3287+ pub { const } fn WCOREDUMP ( status: :: c_int) -> bool {
3288+ ( status & 0x80 ) != 0
3289+ }
3290+
3291+ pub { const } fn QCMD ( cmd: :: c_int, type_: :: c_int) -> :: c_int {
3292+ ( cmd << 8 ) | ( type_ & 0x00ff )
3293+ }
3294+ }
3295+
32943296fn __CMSG_LEN ( cmsg : * const cmsghdr ) -> :: ssize_t {
32953297 ( ( unsafe { ( * cmsg) . cmsg_len as :: size_t } + :: mem:: size_of :: < :: c_long > ( )
32963298 - 1 )
@@ -3302,9 +3304,8 @@ fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar {
33023304}
33033305
33043306fn __MHDR_END ( mhdr : * const msghdr ) -> * mut c_uchar {
3305- unsafe {
3306- ( * mhdr) . msg_control . offset ( ( * mhdr) . msg_controllen as isize )
3307- } . cast ( )
3307+ unsafe { ( * mhdr) . msg_control . offset ( ( * mhdr) . msg_controllen as isize ) }
3308+ . cast ( )
33083309}
33093310
33103311// EXTERN_FN
0 commit comments