This crate provides a direct binding to the pidfd_getfd
syscall, as well as
a slightly more convenient wrapper, get_file_from_pidfd
. This also contains
an extension trait for the pidfd
crate
which provides access to pidfd_getfd
via PidFdExt::get_fd()
.
Please note that this crate has not been thoroughly tested. Viewer discretion is advised.
```rust use pidfdgetfd::{getfilefrompidfd, GetFdFlags}; use std::io::Read;
let pidfd: RawFd = /* ... /; let target_fd: RawFd = / ... */; let file = getfilefrompidfd(pidfd, targetfd, GetFdFlags::empty()); let mut buf = Vec::new(); file.readtoend(&mut buf)?; println!("{:#?}", buf); ```