1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//! inotify support for working with inotify objects.

use crate::backend::c;
use bitflags::bitflags;

bitflags! {
    /// `IN_*` for use with [`inotify::init`].
    ///
    /// [`inotify::init`]: crate::fs::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;
        /// `IN_NONBLOCK`
        const NONBLOCK = linux_raw_sys::general::IN_NONBLOCK;

        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
        const _ = !0;
    }
}

bitflags! {
    /// `IN*` for use with [`inotify::add_watch`].
    ///
    /// [`inotify::add_watch`]: crate::fs::inotify::add_watch
    #[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;
        /// `IN_ATTRIB`
        const ATTRIB = linux_raw_sys::general::IN_ATTRIB;
        /// `IN_CLOSE_NOWRITE`
        const CLOSE_NOWRITE = linux_raw_sys::general::IN_CLOSE_NOWRITE;
        /// `IN_CLOSE_WRITE`
        const CLOSE_WRITE = linux_raw_sys::general::IN_CLOSE_WRITE;
        /// `IN_CREATE`
        const CREATE = linux_raw_sys::general::IN_CREATE;
        /// `IN_DELETE`
        const DELETE = linux_raw_sys::general::IN_DELETE;
        /// `IN_DELETE_SELF`
        const DELETE_SELF = linux_raw_sys::general::IN_DELETE_SELF;
        /// `IN_MODIFY`
        const MODIFY = linux_raw_sys::general::IN_MODIFY;
        /// `IN_MOVE_SELF`
        const MOVE_SELF = linux_raw_sys::general::IN_MOVE_SELF;
        /// `IN_MOVED_FROM`
        const MOVED_FROM = linux_raw_sys::general::IN_MOVED_FROM;
        /// `IN_MOVED_TO`
        const MOVED_TO = linux_raw_sys::general::IN_MOVED_TO;
        /// `IN_OPEN`
        const OPEN = linux_raw_sys::general::IN_OPEN;

        /// `IN_CLOSE`
        const CLOSE = linux_raw_sys::general::IN_CLOSE;
        /// `IN_MOVE`
        const MOVE = linux_raw_sys::general::IN_MOVE;
        /// `IN_ALL_EVENTS`
        const ALL_EVENTS = linux_raw_sys::general::IN_ALL_EVENTS;

        /// `IN_DONT_FOLLOW`
        const DONT_FOLLOW = linux_raw_sys::general::IN_DONT_FOLLOW;
        /// `IN_EXCL_UNLINK`
        const EXCL_UNLINK = linux_raw_sys::general::IN_EXCL_UNLINK;
        /// `IN_MASK_ADD`
        const MASK_ADD = linux_raw_sys::general::IN_MASK_ADD;
        /// `IN_MASK_CREATE`
        const MASK_CREATE = linux_raw_sys::general::IN_MASK_CREATE;
        /// `IN_ONESHOT`
        const ONESHOT = linux_raw_sys::general::IN_ONESHOT;
        /// `IN_ONLYDIR`
        const ONLYDIR = linux_raw_sys::general::IN_ONLYDIR;

        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
        const _ = !0;
    }
}

bitflags! {
    /// `IN*` for use with [`inotify::Reader`].
    ///
    /// [`inotify::Reader`]: crate::fs::inotify::InotifyReader
    #[repr(transparent)]
    #[derive(Default, Copy, Clone, Eq, PartialEq, Hash, Debug)]
    pub struct ReadFlags: c::c_uint {
        /// `IN_ACCESS`
        const ACCESS = linux_raw_sys::general::IN_ACCESS;
        /// `IN_ATTRIB`
        const ATTRIB = linux_raw_sys::general::IN_ATTRIB;
        /// `IN_CLOSE_NOWRITE`
        const CLOSE_NOWRITE = linux_raw_sys::general::IN_CLOSE_NOWRITE;
        /// `IN_CLOSE_WRITE`
        const CLOSE_WRITE = linux_raw_sys::general::IN_CLOSE_WRITE;
        /// `IN_CREATE`
        const CREATE = linux_raw_sys::general::IN_CREATE;
        /// `IN_DELETE`
        const DELETE = linux_raw_sys::general::IN_DELETE;
        /// `IN_DELETE_SELF`
        const DELETE_SELF = linux_raw_sys::general::IN_DELETE_SELF;
        /// `IN_MODIFY`
        const MODIFY = linux_raw_sys::general::IN_MODIFY;
        /// `IN_MOVE_SELF`
        const MOVE_SELF = linux_raw_sys::general::IN_MOVE_SELF;
        /// `IN_MOVED_FROM`
        const MOVED_FROM = linux_raw_sys::general::IN_MOVED_FROM;
        /// `IN_MOVED_TO`
        const MOVED_TO = linux_raw_sys::general::IN_MOVED_TO;
        /// `IN_OPEN`
        const OPEN = linux_raw_sys::general::IN_OPEN;

        /// `IN_IGNORED`
        const IGNORED = linux_raw_sys::general::IN_IGNORED;
        /// `IN_ISDIR`
        const ISDIR = linux_raw_sys::general::IN_ISDIR;
        /// `IN_Q_OVERFLOW`
        const QUEUE_OVERFLOW = linux_raw_sys::general::IN_Q_OVERFLOW;
        /// `IN_UNMOUNT`
        const UNMOUNT = linux_raw_sys::general::IN_UNMOUNT;

        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
        const _ = !0;
    }
}