summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-03 16:18:04 +0000
committerbors <bors@rust-lang.org>2021-03-03 16:18:04 +0000
commitec86e5fb3258a844ece771d2c6f0fbf152086eab (patch)
tree2e8dc7b31b6bc9ecfc4866fee58d59765da23f8b
parent6b1e6a2a72488481034fc2e1b409f379f96fd8f1 (diff)
parentc334f98ad97fdaa28f431b0c439686eef1048f3f (diff)
downloadrust-libc-ec86e5fb3258a844ece771d2c6f0fbf152086eab.tar.gz
Auto merge of #2097 - cmusser:topic/dfly-waitid, r=JohnTitor
dragonflybsd: expose waitid() prototype + related constants This exposes the POSIX waitid() process management function and some related defined constants for dragonflybsd. It includes one correction: WSTOPPED which previously had the wrong value. Noticed this when a crate that depended on it, process_control, wouldn't compile on this platform.
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 641fb89235..0330183d3f 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -17,6 +17,7 @@ pub type uuid_t = ::uuid;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_uint;
pub type mqd_t = ::c_int;
pub type sem_t = *mut sem;
@@ -982,8 +983,17 @@ pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127;
-pub const WCONTINUED: ::c_int = 4;
-pub const WSTOPPED: ::c_int = 0o177;
+pub const WCONTINUED: ::c_int = 0x4;
+pub const WSTOPPED: ::c_int = 0x2;
+pub const WNOWAIT: ::c_int = 0x8;
+pub const WEXITED: ::c_int = 0x10;
+pub const WTRAPPED: ::c_int = 0x20;
+
+// Similar to FreeBSD, only the standardized ones are exposed.
+// There are more.
+pub const P_PID: idtype_t = 0;
+pub const P_PGID: idtype_t = 2;
+pub const P_ALL: idtype_t = 7;
// Values for struct rtprio (type_ field)
pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
@@ -1061,6 +1071,13 @@ extern "C" {
timeout: *mut ::timespec,
) -> ::c_int;
+ pub fn waitid(
+ idtype: idtype_t,
+ id: ::id_t,
+ infop: *mut ::siginfo_t,
+ options: ::c_int,
+ ) -> ::c_int;
+
pub fn freelocale(loc: ::locale_t);
pub fn lwp_rtprio(