From 98c4da97b5a7168ea91e153a3ece7a0d2cf43875 Mon Sep 17 00:00:00 2001 From: Greg V Date: Mon, 10 Jul 2017 15:53:29 +0300 Subject: [PATCH] Add waitpid flags for *BSD operating systems --- src/sys/wait.rs | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/sys/wait.rs b/src/sys/wait.rs index ee0beade24..acaaec8d57 100644 --- a/src/sys/wait.rs +++ b/src/sys/wait.rs @@ -13,7 +13,12 @@ mod ffi { } #[cfg(not(any(target_os = "linux", - target_os = "android")))] + target_os = "android", + target_os = "openbsd", + target_os = "bitrig", + target_os = "dragonfly", + target_os = "netbsd", + target_os = "freebsd")))] libc_bitflags!( pub flags WaitPidFlag: c_int { WNOHANG, @@ -21,6 +26,40 @@ libc_bitflags!( } ); +#[cfg(target_os = "freebsd")] +libc_bitflags!( + pub flags WaitPidFlag: c_int { + WCONTINUED, + WNOHANG, + WUNTRACED, + WTRAPPED, + WEXITED, + WNOWAIT, + } +); + +#[cfg(target_os = "netbsd")] +libc_bitflags!( + pub flags WaitPidFlag: c_int { + WCONTINUED, + WEXITED, + WNOHANG, + WNOWAIT, + WUNTRACED, + } +); + +#[cfg(any(target_os = "openbsd", + target_os = "bitrig", + target_os = "dragonfly"))] +libc_bitflags!( + pub flags WaitPidFlag: c_int { + WCONTINUED, + WNOHANG, + WUNTRACED, + } +); + #[cfg(any(target_os = "linux", target_os = "android"))] libc_bitflags!( @@ -37,7 +76,9 @@ libc_bitflags!( ); #[cfg(any(target_os = "linux", - target_os = "android"))] + target_os = "android", + target_os = "netbsd", + target_os = "freebsd"))] const WSTOPPED: WaitPidFlag = WUNTRACED; #[derive(Eq, PartialEq, Clone, Copy, Debug)]