pub trait CommandExt: Sealed {
fn create_pidfd(&mut self, val: bool) -> &mut Command;
}
Available on Linux only.
Expand description
Os-specific extensions for Command
Required Methods
fn create_pidfd(&mut self, val: bool) -> &mut Command
fn create_pidfd(&mut self, val: bool) -> &mut Command
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.