Skip to content

Commit 6bfee3c

Browse files
author
Chuck Musser
committed
dragonflybsd: expose waitid() prototype + related constants
This exposes the POSIX waitid() process management function and some related defined constants. It includes one correction: WSTOPPED which previously had the wrong value.
1 parent 5786455 commit 6bfee3c

File tree

1 file changed

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

1 file changed

+21
-2
lines changed

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

+21-2
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,19 @@ 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 WNOHANG: ::c_int = 0x1;
987+
pub const WUNTRACED: ::c_int = 0x2;
988+
pub const WCONTINUED: ::c_int = 0x4;
989+
pub const WSTOPPED: ::c_int = 0x2;
990+
pub const WNOWAIT: ::c_int = 0x8;
991+
pub const WEXITED: ::c_int = 0x10;
992+
pub const WTRAPPED: ::c_int = 0x20;
993+
994+
// Similar to FreeBSD, only the standardized ones are exposed.
995+
// There are more.
996+
pub const P_PID: idtype_t = 0;
997+
pub const P_PGID: idtype_t = 2;
998+
pub const P_ALL: idtype_t = 7;
987999

9881000
// Values for struct rtprio (type_ field)
9891001
pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
@@ -1061,6 +1073,13 @@ extern "C" {
10611073
timeout: *mut ::timespec,
10621074
) -> ::c_int;
10631075

1076+
pub fn waitid(
1077+
idtype: idtype_t,
1078+
id: ::id_t,
1079+
infop: *mut ::siginfo_t,
1080+
options: ::c_int,
1081+
) -> ::c_int;
1082+
10641083
pub fn freelocale(loc: ::locale_t);
10651084

10661085
pub fn lwp_rtprio(

0 commit comments

Comments
 (0)