Skip to content

Commit df0c9c3

Browse files
author
Askar Safin
committed
Finishing clone3 clean up
1 parent 1ee773e commit df0c9c3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/std/src/os/linux/process.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ pub trait CommandExt: Sealed {
149149
/// The pidfd can be retrieved from the child with [`pidfd`] or [`take_pidfd`].
150150
///
151151
/// A pidfd will only be created if it is possible to do so
152-
/// in a guaranteed race-free manner (e.g. if the `clone3` system call
153-
/// is supported). Otherwise, [`pidfd`] will return an error.
152+
/// in a guaranteed race-free manner. Otherwise, [`pidfd`] will return an error.
154153
///
155154
/// If a pidfd has been successfully created and not been taken from the `Child`
156155
/// then calls to `kill()`, `wait()` and `try_wait()` will use the pidfd

library/std/src/sys/pal/unix/process/process_unix.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ impl Command {
147147
#[cfg(not(target_os = "linux"))]
148148
let pidfd = -1;
149149

150-
// Safety: We obtained the pidfd from calling `clone3` with
151-
// `CLONE_PIDFD` so it's valid an otherwise unowned.
150+
// Safety: We obtained the pidfd (on Linux) using SOCK_SEQPACKET, so it's valid.
152151
let mut p = unsafe { Process::new(pid, pidfd) };
153152
let mut bytes = [0; 8];
154153

0 commit comments

Comments
 (0)