sys: impl AsFd for PidFd

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-10-19 14:35:07 +02:00
parent 34f47339d5
commit 34688a6d74

View File

@ -2,7 +2,7 @@
use std::fs::File;
use std::io;
use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
use nix::fcntl::OFlag;
use nix::sys::signal::Signal;
@ -155,6 +155,12 @@ impl PidFd {
}
}
impl AsFd for PidFd {
fn as_fd(&self) -> BorrowedFd<'_> {
self.fd.as_fd()
}
}
impl AsRawFd for PidFd {
fn as_raw_fd(&self) -> RawFd {
self.fd.as_raw_fd()