summaryrefslogtreecommitdiffstats
path: root/library/std/src/os/linux
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/os/linux')
-rw-r--r--library/std/src/os/linux/process.rs6
-rw-r--r--library/std/src/os/linux/raw.rs1
2 files changed, 6 insertions, 1 deletions
diff --git a/library/std/src/os/linux/process.rs b/library/std/src/os/linux/process.rs
index 2b3ff76d7..51af432d0 100644
--- a/library/std/src/os/linux/process.rs
+++ b/library/std/src/os/linux/process.rs
@@ -152,6 +152,12 @@ pub trait CommandExt: Sealed {
/// in a guaranteed race-free manner (e.g. if the `clone3` system call
/// is supported). Otherwise, [`pidfd`] will return an error.
///
+ /// If a pidfd has been successfully created and not been taken from the `Child`
+ /// then calls to `kill()`, `wait()` and `try_wait()` will use the pidfd
+ /// instead of the pid. This can prevent pid recycling races, e.g.
+ /// those caused by rogue libraries in the same process prematurely reaping
+ /// zombie children via `waitpid(-1, ...)` calls.
+ ///
/// [`Command`]: process::Command
/// [`Child`]: process::Child
/// [`pidfd`]: fn@ChildExt::pidfd
diff --git a/library/std/src/os/linux/raw.rs b/library/std/src/os/linux/raw.rs
index a568f9b26..c29dd62bc 100644
--- a/library/std/src/os/linux/raw.rs
+++ b/library/std/src/os/linux/raw.rs
@@ -31,7 +31,6 @@ pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "arm",
- target_arch = "asmjs",
target_arch = "wasm32"
))]
mod arch {