pub trait CommandExt: Sealed {
fn create_pidfd(&mut self, val: bool) -> &mut Command;
}
🔬This is a nightly-only experimental API. (
linux_pidfd
#82971)Available on Linux only.
Expand description
Os-specific extensions for Command
Required Methods§
sourcefn create_pidfd(&mut self, val: bool) -> &mut Command
fn create_pidfd(&mut self, val: bool) -> &mut Command
🔬This is a nightly-only experimental API. (
linux_pidfd
#82971)Sets whether a PidFd
should be created for the Child
spawned by this Command
.
By default, no pidfd will be created.
The pidfd can be retrieved from the child with pidfd
or take_pidfd
.
A pidfd will only be created if it is possible to do so
in a guaranteed race-free manner (e.g. if the clone3
system call
is supported). Otherwise, pidfd
will return an error.