diff --git a/changelog/2515.changed.md b/changelog/2515.changed.md new file mode 100644 index 0000000000..7524b7a40d --- /dev/null +++ b/changelog/2515.changed.md @@ -0,0 +1 @@ +changed the compilation target for the P_PIDFD flag on the wait module to also target linux \ No newline at end of file diff --git a/src/sys/wait.rs b/src/sys/wait.rs index 844e165c18..747db8e7ae 100644 --- a/src/sys/wait.rs +++ b/src/sys/wait.rs @@ -340,7 +340,7 @@ pub enum Id<'fd> { /// If the PID is zero, the caller's process group is used since Linux 5.4. PGid(Pid), /// Wait for the child referred to by the given PID file descriptor - #[cfg(linux_android)] + #[cfg(any(linux_android, target_os = "linux"))] PIDFd(BorrowedFd<'fd>), /// A helper variant to resolve the unused parameter (`'fd`) problem on platforms /// other than Linux and Android. @@ -362,7 +362,7 @@ pub fn waitid(id: Id, flags: WaitPidFlag) -> Result { Id::All => (libc::P_ALL, 0), Id::Pid(pid) => (libc::P_PID, pid.as_raw() as libc::id_t), Id::PGid(pid) => (libc::P_PGID, pid.as_raw() as libc::id_t), - #[cfg(linux_android)] + #[cfg(any(linux_android, target_os = "linux"))] Id::PIDFd(fd) => (libc::P_PIDFD, fd.as_raw_fd() as libc::id_t), Id::_Unreachable(_) => { unreachable!("This variant could never be constructed")