Skip to content

Commit c334f98

Browse files
committed
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.
1 parent 5786455 commit c334f98

File tree

1 file changed

+19
-2
lines changed
  • src/unix/bsd/freebsdlike/dragonfly

1 file changed

+19
-2
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub type uuid_t = ::uuid;
1717

1818
pub type fsblkcnt_t = u64;
1919
pub type fsfilcnt_t = u64;
20+
pub type idtype_t = ::c_uint;
2021

2122
pub type mqd_t = ::c_int;
2223
pub type sem_t = *mut sem;
@@ -982,8 +983,17 @@ pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125;
982983
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126;
983984
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127;
984985

985-
pub const WCONTINUED: ::c_int = 4;
986-
pub const WSTOPPED: ::c_int = 0o177;
986+
pub const WCONTINUED: ::c_int = 0x4;
987+
pub const WSTOPPED: ::c_int = 0x2;
988+
pub const WNOWAIT: ::c_int = 0x8;
989+
pub const WEXITED: ::c_int = 0x10;
990+
pub const WTRAPPED: ::c_int = 0x20;
991+
992+
// Similar to FreeBSD, only the standardized ones are exposed.
993+
// There are more.
994+
pub const P_PID: idtype_t = 0;
995+
pub const P_PGID: idtype_t = 2;
996+
pub const P_ALL: idtype_t = 7;
987997

988998
// Values for struct rtprio (type_ field)
989999
pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
@@ -1061,6 +1071,13 @@ extern "C" {
10611071
timeout: *mut ::timespec,
10621072
) -> ::c_int;
10631073

1074+
pub fn waitid(
1075+
idtype: idtype_t,
1076+
id: ::id_t,
1077+
infop: *mut ::siginfo_t,
1078+
options: ::c_int,
1079+
) -> ::c_int;
1080+
10641081
pub fn freelocale(loc: ::locale_t);
10651082

10661083
pub fn lwp_rtprio(

0 commit comments

Comments
 (0)