pub struct PidFd(/* private fields */);
Expand description
A process file descriptor.
Implementations§
Source§impl PidFd
impl PidFd
Sourcepub fn from_pid(pid: pid_t) -> Result<Self>
pub fn from_pid(pid: pid_t) -> Result<Self>
Create a process file descriptor from a PID.
You can get a process ID from std::process::Child
by calling Child::id
.
As long as this process has not yet waited on the child process, and has not blocked
SIGCHLD
, the process ID will not get reused, so it does not matter if the child process
has already exited.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PidFd
impl RefUnwindSafe for PidFd
impl Send for PidFd
impl Sync for PidFd
impl Unpin for PidFd
impl UnwindSafe for PidFd
Blanket Implementations§
Source§impl<T> AsSource for Twhere
T: AsFd,
impl<T> AsSource for Twhere
T: AsFd,
Source§fn source(&self) -> BorrowedFd<'_>
fn source(&self) -> BorrowedFd<'_>
Returns the borrowed file descriptor.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more