diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/rustix/src/backend/linux_raw/fs/inotify.rs | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/backend/linux_raw/fs/inotify.rs')
-rw-r--r-- | vendor/rustix/src/backend/linux_raw/fs/inotify.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/rustix/src/backend/linux_raw/fs/inotify.rs b/vendor/rustix/src/backend/linux_raw/fs/inotify.rs index a3c274741..cb9d87b82 100644 --- a/vendor/rustix/src/backend/linux_raw/fs/inotify.rs +++ b/vendor/rustix/src/backend/linux_raw/fs/inotify.rs @@ -1,6 +1,6 @@ //! inotify support for working with inotifies -use super::super::c; +use crate::backend::c; use crate::backend::fs::syscalls; use crate::fd::{BorrowedFd, OwnedFd}; use crate::io; @@ -10,6 +10,8 @@ bitflags! { /// `IN_*` for use with [`inotify_init`]. /// /// [`inotify_init`]: crate::fs::inotify::inotify_init + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct CreateFlags: c::c_uint { /// `IN_CLOEXEC` const CLOEXEC = linux_raw_sys::general::IN_CLOEXEC; @@ -22,7 +24,8 @@ bitflags! { /// `IN*` for use with [`inotify_add_watch`]. /// /// [`inotify_add_watch`]: crate::fs::inotify::inotify_add_watch - #[derive(Default)] + #[repr(transparent)] + #[derive(Default, Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct WatchFlags: c::c_uint { /// `IN_ACCESS` const ACCESS = linux_raw_sys::general::IN_ACCESS; @@ -76,6 +79,7 @@ bitflags! { /// Use the [`CreateFlags::CLOEXEC`] flag to prevent the resulting file /// descriptor from being implicitly passed across `exec` boundaries. #[doc(alias = "inotify_init1")] +#[inline] pub fn inotify_init(flags: CreateFlags) -> io::Result<OwnedFd> { syscalls::inotify_init1(flags) } @@ -89,6 +93,7 @@ pub fn inotify_init(flags: CreateFlags) -> io::Result<OwnedFd> { /// different paths to this method may result in it returning /// the same watch descriptor. An application should keep track of this /// externally to avoid logic errors. +#[inline] pub fn inotify_add_watch<P: crate::path::Arg>( inot: BorrowedFd<'_>, path: P, @@ -103,6 +108,7 @@ pub fn inotify_add_watch<P: crate::path::Arg>( /// The watch descriptor provided should have previously been returned /// by [`inotify_add_watch`] and not previously have been removed. #[doc(alias = "inotify_rm_watch")] +#[inline] pub fn inotify_remove_watch(inot: BorrowedFd<'_>, wd: i32) -> io::Result<()> { syscalls::inotify_rm_watch(inot, wd) } |