Skip to content

Commit

Permalink
Auto merge of #3188 - valpackett:waitconst, r=JohnTitor
Browse files Browse the repository at this point in the history
netbsd,openbsd: add more waitid related constants

`P_ALL`/`P_PID`/`WEXITED`/`WNOWAIT`/`WSTOPPED` in particular are what's required for rustix to support waitid and they were missing on OpenBSD; while here add NetBSD's custom ones.

ping `@semarie`
  • Loading branch information
bors committed Apr 12, 2023
2 parents 7e3c99c + e57e4a7 commit 88740ef
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libc-test/semver/netbsd.txt
Expand Up @@ -1055,9 +1055,13 @@ VM_PROC_MAP
VREPRINT
VSTATUS
VWERASE
WALLSIG
WALTSIG
WEXITED
WNOWAIT
WNOZOMBIE
WSTOPPED
WTRAPPED
YESEXPR
YESSTR
_IOFBF
Expand Down
7 changes: 7 additions & 0 deletions libc-test/semver/openbsd.txt
Expand Up @@ -618,6 +618,9 @@ O_RSYNC
O_SHLOCK
O_SYNC
PENDIN
P_ALL
P_PGID
P_PID
PF_APPLETALK
PF_BLUETOOTH
PF_BPF
Expand Down Expand Up @@ -835,6 +838,10 @@ UTIME_OMIT
UT_HOSTSIZE
UT_LINESIZE
UT_NAMESIZE
WEXITED
WNOWAIT
WSTOPPED
WTRAPPED
VDISCARD
VDSUSP
VLNEXT
Expand Down
5 changes: 5 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -2220,6 +2220,11 @@ pub const WCONTINUED: ::c_int = 0x00000010;
pub const WEXITED: ::c_int = 0x000000020;
pub const WNOWAIT: ::c_int = 0x00010000;

pub const WALTSIG: ::c_int = 0x00000004;
pub const WALLSIG: ::c_int = 0x00000008;
pub const WTRAPPED: ::c_int = 0x00000040;
pub const WNOZOMBIE: ::c_int = 0x00020000;

pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 4;
Expand Down
11 changes: 10 additions & 1 deletion src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -7,6 +7,7 @@ pub type sigset_t = ::c_uint;
pub type blksize_t = i32;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_mutex_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
Expand Down Expand Up @@ -1615,7 +1616,15 @@ pub const BIOCSDLT: ::c_ulong = 0x8004427a;

pub const PTRACE_FORK: ::c_int = 0x0002;

pub const WCONTINUED: ::c_int = 8;
pub const WCONTINUED: ::c_int = 0x08;
pub const WEXITED: ::c_int = 0x04;
pub const WSTOPPED: ::c_int = 0x02; // same as WUNTRACED
pub const WNOWAIT: ::c_int = 0x10;
pub const WTRAPPED: ::c_int = 0x20;

pub const P_ALL: ::idtype_t = 0;
pub const P_PGID: ::idtype_t = 1;
pub const P_PID: ::idtype_t = 2;

// search.h
pub const FIND: ::ACTION = 0;
Expand Down

0 comments on commit 88740ef

Please sign in to comment.