From 9d0e75755887c42cd0732879de93a77f7b2dfc01 Mon Sep 17 00:00:00 2001 From: Navneet Aman Date: Sat, 20 Dec 2025 12:20:15 +0530 Subject: [PATCH 1/2] Add api to get inner WatchDescriptor id, to work with c code. --- src/sys/inotify.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sys/inotify.rs b/src/sys/inotify.rs index 3a00ea0d1d..4e8769eead 100644 --- a/src/sys/inotify.rs +++ b/src/sys/inotify.rs @@ -113,6 +113,12 @@ pub struct Inotify { pub struct WatchDescriptor { wd: i32, } +impl WatchDescriptor { + /// Inner WatchDescriptor, from libc. + pub fn inner_id(self) -> i32 { + self.wd + } +} /// A single inotify event. /// @@ -270,4 +276,4 @@ impl From for OwnedFd { fn from(value: Inotify) -> Self { value.fd } -} \ No newline at end of file +} From 53c2e57c5a50526f68f6b2af1b604546a3641e9d Mon Sep 17 00:00:00 2001 From: Navneet Aman Date: Sat, 20 Dec 2025 12:26:04 +0530 Subject: [PATCH 2/2] changelog --- changelog/2718.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/2718.added.md diff --git a/changelog/2718.added.md b/changelog/2718.added.md new file mode 100644 index 0000000000..8c80e804e7 --- /dev/null +++ b/changelog/2718.added.md @@ -0,0 +1 @@ +Add WatchDescriptor::inner_id, to get libc id of WatchDescriptor.