From a401851cfc985171de7617ae6b1b7e4998f80ccd Mon Sep 17 00:00:00 2001 From: Valentyn Kit Date: Fri, 24 Jul 2026 20:19:54 +0300 Subject: [PATCH] std: retry waitid on EINTR in the pidfd wait path --- library/std/src/sys/process/unix/pidfd.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/process/unix/pidfd.rs b/library/std/src/sys/process/unix/pidfd.rs index ef8433068c967..c586354861dcd 100644 --- a/library/std/src/sys/process/unix/pidfd.rs +++ b/library/std/src/sys/process/unix/pidfd.rs @@ -2,7 +2,7 @@ use super::ExitStatus; use crate::io; use crate::os::fd::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; use crate::sys::fd::FileDesc; -use crate::sys::{AsInner, FromInner, IntoInner, cvt}; +use crate::sys::{AsInner, FromInner, IntoInner, cvt, cvt_r}; #[cfg(test)] mod tests; @@ -61,7 +61,7 @@ impl PidFd { fn waitid(&self, options: libc::c_int) -> io::Result> { let mut siginfo: libc::siginfo_t = unsafe { crate::mem::zeroed() }; - let r = cvt(unsafe { + let r = cvt_r(|| unsafe { libc::waitid(libc::P_PIDFD, self.0.as_raw_fd() as u32, &mut siginfo, options) }); match r {