summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-08-19 07:45:41 +0900
committerGitHub <noreply@github.com>2020-08-19 07:45:41 +0900
commitb1793090f4b9e82792b9f985d9b59f42036ad865 (patch)
treec942f9f2dd52329f9c973289cc646a85c78f7969
parentc6c865ef5e8142a68b1698f3200f4dfd42ccef84 (diff)
parente709b3f78a2ae3cb4cab1222c1848797ebbe4735 (diff)
downloadrust-libc-b1793090f4b9e82792b9f985d9b59f42036ad865.tar.gz
Merge pull request #1861 from joshtriplett/p_pidfd
-rw-r--r--libc-test/build.rs9
-rw-r--r--src/unix/linux_like/mod.rs5
2 files changed, 14 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ddd3b65d8a..ff5efb82b1 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1487,6 +1487,7 @@ fn test_android(target: &str) {
"linux/seccomp.h",
"linux/sched.h",
"linux/sockios.h",
+ "linux/wait.h",
}
@@ -1557,6 +1558,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,
}
});
@@ -2443,6 +2447,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",
}
@@ -2627,6 +2632,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,
}
});
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index c6542288ac..a48c3aaaad 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -1041,6 +1041,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;