Skip to content

Commit

Permalink
I propose exposing the std::os::fd::AsRawFd trait method for ``…
Browse files Browse the repository at this point in the history
…`nix::sys::fanotify::Fanotify``` struct (#2575)

* Exposed the ```std::os::fd::AsRawFd``` trait method for ```nix::sys::fanotify::Fanotify``` struct

* Pull request number is set
  • Loading branch information
ChrysoliteAzalea authored Jan 2, 2025
1 parent aeb6fac commit 29bbd8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/2575.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Exposed the ```std::os::fd::AsRawFd``` trait method for ```nix::sys::fanotify::Fanotify``` struct
7 changes: 7 additions & 0 deletions src/sys/fanotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ impl AsFd for Fanotify {
}
}

impl AsRawFd for Fanotify {
fn as_raw_fd(&self) -> RawFd
{
self.fd.as_raw_fd()
}
}

impl From<Fanotify> for OwnedFd {
fn from(value: Fanotify) -> Self {
value.fd
Expand Down

0 comments on commit 29bbd8e

Please sign in to comment.