File tree Expand file tree Collapse file tree 4 files changed +52
-8
lines changed Expand file tree Collapse file tree 4 files changed +52
-8
lines changed Original file line number Diff line number Diff line change @@ -685,6 +685,20 @@ pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
685
685
686
686
pub const SEM_FAILED : * mut sem_t = 0 as * mut sem_t ;
687
687
688
+ f ! {
689
+ pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
690
+ status >> 8
691
+ }
692
+
693
+ pub fn WIFSIGNALED ( status: :: c_int) -> bool {
694
+ ( status & 0o177 ) != 0o177 && ( status & 0o177 ) != 0
695
+ }
696
+
697
+ pub fn WIFSTOPPED ( status: :: c_int) -> bool {
698
+ ( status & 0o177 ) == 0o177
699
+ }
700
+ }
701
+
688
702
#[ link( name = "util" ) ]
689
703
extern {
690
704
pub fn getnameinfo ( sa : * const :: sockaddr ,
Original file line number Diff line number Diff line change @@ -324,18 +324,18 @@ f! {
324
324
}
325
325
}
326
326
327
+ pub fn WTERMSIG ( status: :: c_int) -> :: c_int {
328
+ status & 0o177
329
+ }
330
+
327
331
pub fn WIFEXITED ( status: :: c_int) -> bool {
328
- ( status & 0x7f ) == 0
332
+ ( status & 0o177 ) == 0
329
333
}
330
334
331
335
pub fn WEXITSTATUS ( status: :: c_int) -> :: c_int {
332
336
status >> 8
333
337
}
334
338
335
- pub fn WTERMSIG ( status: :: c_int) -> :: c_int {
336
- status & 0o177
337
- }
338
-
339
339
pub fn WCOREDUMP ( status: :: c_int) -> bool {
340
340
( status & 0o200 ) != 0
341
341
}
Original file line number Diff line number Diff line change @@ -449,6 +449,20 @@ pub const HW_NCPU: ::c_int = 3;
449
449
450
450
pub const SEM_FAILED : * mut sem_t = 0 as * mut sem_t ;
451
451
452
+ f ! {
453
+ pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
454
+ status >> 8
455
+ }
456
+
457
+ pub fn WIFSIGNALED ( status: :: c_int) -> bool {
458
+ ( status & 0o177 ) != 0o177 && ( status & 0o177 ) != 0
459
+ }
460
+
461
+ pub fn WIFSTOPPED ( status: :: c_int) -> bool {
462
+ ( status & 0o177 ) == 0o177
463
+ }
464
+ }
465
+
452
466
#[ link( name = "util" ) ]
453
467
extern {
454
468
pub fn mincore ( addr : * mut :: c_void , len : :: size_t ,
Original file line number Diff line number Diff line change @@ -682,17 +682,33 @@ f! {
682
682
}
683
683
}
684
684
685
- pub fn WIFEXITED ( status: :: c_int) -> bool {
686
- ( status & 0xff ) == 0
685
+ pub fn WIFSTOPPED ( status: :: c_int) -> bool {
686
+ ( status & 0xff ) == 0x7f
687
687
}
688
688
689
- pub fn WEXITSTATUS ( status: :: c_int) -> :: c_int {
689
+ pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
690
690
( status >> 8 ) & 0xff
691
691
}
692
692
693
+ pub fn WIFSIGNALED ( status: :: c_int) -> bool {
694
+ ( status & 0x7f ) + 1 >= 2
695
+ }
696
+
693
697
pub fn WTERMSIG ( status: :: c_int) -> :: c_int {
694
698
status & 0x7f
695
699
}
700
+
701
+ pub fn WIFEXITED ( status: :: c_int) -> bool {
702
+ ( status & 0x7f ) == 0
703
+ }
704
+
705
+ pub fn WEXITSTATUS ( status: :: c_int) -> :: c_int {
706
+ ( status >> 8 ) & 0xff
707
+ }
708
+
709
+ pub fn WCOREDUMP ( status: :: c_int) -> bool {
710
+ ( status & 0x80 ) != 0
711
+ }
696
712
}
697
713
698
714
extern {
You can’t perform that action at this time.
0 commit comments