Skip to content

Commit a58ff1f

Browse files
droundycarllerche
authored andcommitted
support more flags to waitpid and wait on linux
1 parent 1b97d96 commit a58ff1f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/sys/wait.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,33 @@ mod ffi {
1212
}
1313
}
1414

15+
#[cfg(not(any(target_os = "linux",
16+
target_os = "android")))]
1517
bitflags!(
1618
flags WaitPidFlag: c_int {
17-
const WNOHANG = 0x00000001,
19+
const WNOHANG = 0x00000001,
1820
}
1921
);
2022

23+
#[cfg(any(target_os = "linux",
24+
target_os = "android"))]
25+
bitflags!(
26+
flags WaitPidFlag: c_int {
27+
const WNOHANG = 0x00000001,
28+
const WUNTRACED = 0x00000002,
29+
const WEXITED = 0x00000004,
30+
const WCONTINUED = 0x00000008,
31+
const WNOWAIT = 0x01000000, // Don't reap, just poll status.
32+
const __WNOTHREAD = 0x20000000, // Don't wait on children of other threads in this group
33+
const __WALL = 0x40000000, // Wait on all children, regardless of type
34+
// const __WCLONE = 0x80000000,
35+
}
36+
);
37+
38+
#[cfg(any(target_os = "linux",
39+
target_os = "android"))]
40+
const WSTOPPED: WaitPidFlag = WUNTRACED;
41+
2142
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
2243
pub enum WaitStatus {
2344
Exited(pid_t, i8),

0 commit comments

Comments
 (0)