Skip to content

Commit b179309

Browse files
authored
Merge pull request #1861 from joshtriplett/p_pidfd
2 parents c6c865e + e709b3f commit b179309

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libc-test/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ fn test_android(target: &str) {
14871487
"linux/seccomp.h",
14881488
"linux/sched.h",
14891489
"linux/sockios.h",
1490+
"linux/wait.h",
14901491

14911492
}
14921493

@@ -1557,6 +1558,9 @@ fn test_android(target: &str) {
15571558
// FIXME: deprecated - removed in glibc 2.26
15581559
"SIGUNUSED" => true,
15591560

1561+
// Needs a newer Android SDK for the definition
1562+
"P_PIDFD" => true,
1563+
15601564
_ => false,
15611565
}
15621566
});
@@ -2443,6 +2447,7 @@ fn test_linux(target: &str) {
24432447
"linux/seccomp.h",
24442448
"linux/sockios.h",
24452449
"linux/vm_sockets.h",
2450+
"linux/wait.h",
24462451
"sys/auxv.h",
24472452
"sys/fanotify.h",
24482453
}
@@ -2627,6 +2632,10 @@ fn test_linux(target: &str) {
26272632
// Require Linux kernel 5.6:
26282633
"VMADDR_CID_LOCAL" => true,
26292634

2635+
// Defined in kernel headers but musl removes it; need musl 1.2 for definition in musl
2636+
// headers.
2637+
"P_PIDFD" => true,
2638+
26302639
_ => false,
26312640
}
26322641
});

src/unix/linux_like/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,11 @@ pub const SIGEV_THREAD: ::c_int = 2;
10411041
pub const P_ALL: idtype_t = 0;
10421042
pub const P_PID: idtype_t = 1;
10431043
pub const P_PGID: idtype_t = 2;
1044+
cfg_if! {
1045+
if #[cfg(not(target_os = "emscripten"))] {
1046+
pub const P_PIDFD: idtype_t = 3;
1047+
}
1048+
}
10441049

10451050
pub const UTIME_OMIT: c_long = 1073741822;
10461051
pub const UTIME_NOW: c_long = 1073741823;

0 commit comments

Comments
 (0)