From 29bbd8effe72d0ea4b0c9f7e92f83e94ea347da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=B7=D0=B0=D0=BB=D0=B8=D1=8F=20=D0=A1=D0=BC=D0=B0?= =?UTF-8?q?=D1=80=D0=B0=D0=B3=D0=B4=D0=BE=D0=B2=D0=B0?= <64576901+ChrysoliteAzalea@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:38:50 +0500 Subject: [PATCH] I propose exposing the ```std::os::fd::AsRawFd``` trait method for ```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 --- changelog/2575.added.md | 1 + src/sys/fanotify.rs | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 changelog/2575.added.md diff --git a/changelog/2575.added.md b/changelog/2575.added.md new file mode 100644 index 0000000000..cfd5921a9b --- /dev/null +++ b/changelog/2575.added.md @@ -0,0 +1 @@ +Exposed the ```std::os::fd::AsRawFd``` trait method for ```nix::sys::fanotify::Fanotify``` struct \ No newline at end of file diff --git a/src/sys/fanotify.rs b/src/sys/fanotify.rs index c2bde9a841..fd3089f702 100644 --- a/src/sys/fanotify.rs +++ b/src/sys/fanotify.rs @@ -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 for OwnedFd { fn from(value: Fanotify) -> Self { value.fd