Skip to content

Commit

Permalink
Auto merge of rust-lang#379 - nikklassen:wait-flags, r=fiveop
Browse files Browse the repository at this point in the history
Add missing wait flag WUNTRACED for non-Linux systems

My understanding is that this flag is required by POSIX, so all systems should allow for it
  • Loading branch information
homu committed Jul 1, 2016
2 parents 3e43849 + 8fb0c51 commit a869f5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ preadv_pwritev = []
signalfd = []

[dependencies]
libc = "0.2.11"
libc = "0.2.13"
bitflags = "0.4"
cfg-if = "0.1.0"
void = "1.0.2"
Expand Down
21 changes: 11 additions & 10 deletions src/sys/wait.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use libc::{pid_t, c_int};
use libc::{self, pid_t, c_int};
use {Errno, Result};

use sys::signal::Signal;
Expand All @@ -15,22 +15,23 @@ mod ffi {
target_os = "android")))]
bitflags!(
flags WaitPidFlag: c_int {
const WNOHANG = 0x00000001,
const WNOHANG = libc::WNOHANG,
const WUNTRACED = libc::WUNTRACED,
}
);

#[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,
const WNOHANG = libc::WNOHANG,
const WUNTRACED = libc::WUNTRACED,
const WEXITED = libc::WEXITED,
const WCONTINUED = libc::WCONTINUED,
const WNOWAIT = libc::WNOWAIT, // Don't reap, just poll status.
const __WNOTHREAD = libc::__WNOTHREAD, // Don't wait on children of other threads in this group
const __WALL = libc::__WALL, // Wait on all children, regardless of type
const __WCLONE = libc::__WCLONE,
}
);

Expand Down

0 comments on commit a869f5c

Please sign in to comment.