summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Roundy <roundyd@physics.oregonstate.edu>2015-12-01 14:21:38 -0500
committerCarl Lerche <me@carllerche.com>2015-12-03 13:17:06 -0800
commita58ff1f57f59c8a35e3a2b61354b050c557501b9 (patch)
tree75bce99ee885883c6f7f03eeb66f4145ddb92b20 /src
parent1b97d964ece80f9fff9adad721dbaffe92d90a07 (diff)
downloadnix-a58ff1f57f59c8a35e3a2b61354b050c557501b9.zip
support more flags to waitpid and wait on linux
Diffstat (limited to 'src')
-rw-r--r--src/sys/wait.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/sys/wait.rs b/src/sys/wait.rs
index 59f7f5c4..530ef7fa 100644
--- a/src/sys/wait.rs
+++ b/src/sys/wait.rs
@@ -12,12 +12,33 @@ mod ffi {
}
}
+#[cfg(not(any(target_os = "linux",
+ target_os = "android")))]
bitflags!(
flags WaitPidFlag: c_int {
- const WNOHANG = 0x00000001,
+ const WNOHANG = 0x00000001,
}
);
+#[cfg(any(target_os = "linux",
+ target_os = "android"))]
+bitflags!(
+ flags WaitPidFlag: c_int {
+ const WNOHANG = 0x00000001,
+ const WUNTRACED = 0x00000002,
+ const WEXITED = 0x00000004,
+ const WCONTINUED = 0x00000008,
+ const WNOWAIT = 0x01000000, // Don't reap, just poll status.
+ const __WNOTHREAD = 0x20000000, // Don't wait on children of other threads in this group
+ const __WALL = 0x40000000, // Wait on all children, regardless of type
+ // const __WCLONE = 0x80000000,
+ }
+);
+
+#[cfg(any(target_os = "linux",
+ target_os = "android"))]
+const WSTOPPED: WaitPidFlag = WUNTRACED;
+
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub enum WaitStatus {
Exited(pid_t, i8),