Skip to content

Commit a869f5c

Browse files
committed
Auto merge of #379 - nikklassen:wait-flags, r=fiveop
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
2 parents 3e43849 + 8fb0c51 commit a869f5c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ preadv_pwritev = []
2323
signalfd = []
2424

2525
[dependencies]
26-
libc = "0.2.11"
26+
libc = "0.2.13"
2727
bitflags = "0.4"
2828
cfg-if = "0.1.0"
2929
void = "1.0.2"

src/sys/wait.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use libc::{pid_t, c_int};
1+
use libc::{self, pid_t, c_int};
22
use {Errno, Result};
33

44
use sys::signal::Signal;
@@ -15,22 +15,23 @@ mod ffi {
1515
target_os = "android")))]
1616
bitflags!(
1717
flags WaitPidFlag: c_int {
18-
const WNOHANG = 0x00000001,
18+
const WNOHANG = libc::WNOHANG,
19+
const WUNTRACED = libc::WUNTRACED,
1920
}
2021
);
2122

2223
#[cfg(any(target_os = "linux",
2324
target_os = "android"))]
2425
bitflags!(
2526
flags WaitPidFlag: c_int {
26-
const WNOHANG = 0x00000001,
27-
const WUNTRACED = 0x00000002,
28-
const WEXITED = 0x00000004,
29-
const WCONTINUED = 0x00000008,
30-
const WNOWAIT = 0x01000000, // Don't reap, just poll status.
31-
const __WNOTHREAD = 0x20000000, // Don't wait on children of other threads in this group
32-
const __WALL = 0x40000000, // Wait on all children, regardless of type
33-
// const __WCLONE = 0x80000000,
27+
const WNOHANG = libc::WNOHANG,
28+
const WUNTRACED = libc::WUNTRACED,
29+
const WEXITED = libc::WEXITED,
30+
const WCONTINUED = libc::WCONTINUED,
31+
const WNOWAIT = libc::WNOWAIT, // Don't reap, just poll status.
32+
const __WNOTHREAD = libc::__WNOTHREAD, // Don't wait on children of other threads in this group
33+
const __WALL = libc::__WALL, // Wait on all children, regardless of type
34+
const __WCLONE = libc::__WCLONE,
3435
}
3536
);
3637

0 commit comments

Comments
 (0)