rustix/backend/libc/event/
types.rs

1#[cfg(any(linux_kernel, target_os = "freebsd", target_os = "illumos"))]
2use crate::backend::c;
3#[cfg(any(
4    linux_kernel,
5    target_os = "freebsd",
6    target_os = "illumos",
7    target_os = "espidf"
8))]
9use bitflags::bitflags;
10
11#[cfg(any(
12    linux_kernel,
13    target_os = "freebsd",
14    target_os = "illumos",
15    target_os = "espidf"
16))]
17bitflags! {
18    /// `EFD_*` flags for use with [`eventfd`].
19    ///
20    /// [`eventfd`]: crate::event::eventfd
21    #[repr(transparent)]
22    #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
23    pub struct EventfdFlags: u32 {
24        /// `EFD_CLOEXEC`
25        #[cfg(not(target_os = "espidf"))]
26        const CLOEXEC = bitcast!(c::EFD_CLOEXEC);
27        /// `EFD_NONBLOCK`
28        #[cfg(not(target_os = "espidf"))]
29        const NONBLOCK = bitcast!(c::EFD_NONBLOCK);
30        /// `EFD_SEMAPHORE`
31        #[cfg(not(target_os = "espidf"))]
32        const SEMAPHORE = bitcast!(c::EFD_SEMAPHORE);
33
34        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
35        const _ = !0;
36    }
37}