rustix/backend/linux_raw/event/
epoll.rs

1use crate::backend::c;
2use bitflags::bitflags;
3
4bitflags! {
5    /// `EPOLL_*` for use with [`epoll::create`].
6    ///
7    /// [`epoll::create`]: crate::event::epoll::create
8    #[repr(transparent)]
9    #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
10    pub struct CreateFlags: c::c_uint {
11        /// `EPOLL_CLOEXEC`
12        const CLOEXEC = linux_raw_sys::general::EPOLL_CLOEXEC;
13
14        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
15        const _ = !0;
16    }
17}
18
19bitflags! {
20    /// `EPOLL*` for use with [`epoll::add`].
21    ///
22    /// [`epoll::add`]: crate::event::epoll::add
23    #[repr(transparent)]
24    #[derive(Default, Copy, Clone, Eq, PartialEq, Hash, Debug)]
25    pub struct EventFlags: u32 {
26        /// `EPOLLIN`
27        const IN = linux_raw_sys::general::EPOLLIN as u32;
28
29        /// `EPOLLOUT`
30        const OUT = linux_raw_sys::general::EPOLLOUT as u32;
31
32        /// `EPOLLPRI`
33        const PRI = linux_raw_sys::general::EPOLLPRI as u32;
34
35        /// `EPOLLERR`
36        const ERR = linux_raw_sys::general::EPOLLERR as u32;
37
38        /// `EPOLLHUP`
39        const HUP = linux_raw_sys::general::EPOLLHUP as u32;
40
41        /// `EPOLLRDNORM`
42        const RDNORM = linux_raw_sys::general::EPOLLRDNORM as u32;
43
44        /// `EPOLLRDBAND`
45        const RDBAND = linux_raw_sys::general::EPOLLRDBAND as u32;
46
47        /// `EPOLLWRNORM`
48        const WRNORM = linux_raw_sys::general::EPOLLWRNORM as u32;
49
50        /// `EPOLLWRBAND`
51        const WRBAND = linux_raw_sys::general::EPOLLWRBAND as u32;
52
53        /// `EPOLLMSG`
54        const MSG = linux_raw_sys::general::EPOLLMSG as u32;
55
56        /// `EPOLLRDHUP`
57        const RDHUP = linux_raw_sys::general::EPOLLRDHUP as u32;
58
59        /// `EPOLLET`
60        const ET = linux_raw_sys::general::EPOLLET as u32;
61
62        /// `EPOLLONESHOT`
63        const ONESHOT = linux_raw_sys::general::EPOLLONESHOT as u32;
64
65        /// `EPOLLWAKEUP`
66        const WAKEUP = linux_raw_sys::general::EPOLLWAKEUP as u32;
67
68        /// `EPOLLEXCLUSIVE`
69        const EXCLUSIVE = linux_raw_sys::general::EPOLLEXCLUSIVE as u32;
70
71        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
72        const _ = !0;
73    }
74}