Define P_PIDFD, used with waitid

Linux defines a waitid type `P_PIDFD`, for use with process file
descriptors (`pidfd`). Add that constant.

In libc-test, add linux/wait.h to the Linux-specific and
Android-specific headers, to get the definition. Exclude it on Android
and musl for now, though, as the versions in CI don't have it yet.
This commit is contained in:
Josh Triplett 2020-08-09 17:01:21 -07:00
parent ab3c229140
commit e709b3f78a
2 changed files with 14 additions and 0 deletions

View File

@ -1486,6 +1486,7 @@ fn test_android(target: &str) {
"linux/seccomp.h",
"linux/sched.h",
"linux/sockios.h",
"linux/wait.h",
}
@ -1556,6 +1557,9 @@ fn test_android(target: &str) {
// FIXME: deprecated - removed in glibc 2.26
"SIGUNUSED" => true,
// Needs a newer Android SDK for the definition
"P_PIDFD" => true,
_ => false,
}
});
@ -2442,6 +2446,7 @@ fn test_linux(target: &str) {
"linux/seccomp.h",
"linux/sockios.h",
"linux/vm_sockets.h",
"linux/wait.h",
"sys/auxv.h",
"sys/fanotify.h",
}
@ -2626,6 +2631,10 @@ fn test_linux(target: &str) {
// Require Linux kernel 5.6:
"VMADDR_CID_LOCAL" => true,
// Defined in kernel headers but musl removes it; need musl 1.2 for definition in musl
// headers.
"P_PIDFD" => true,
_ => false,
}
});

View File

@ -1034,6 +1034,11 @@ pub const SIGEV_THREAD: ::c_int = 2;
pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 2;
cfg_if! {
if #[cfg(not(target_os = "emscripten"))] {
pub const P_PIDFD: idtype_t = 3;
}
}
pub const UTIME_OMIT: c_long = 1073741822;
pub const UTIME_NOW: c_long = 1073741823;