xref: /third_party/rust/crates/rustix/src/io/eventfd.rs (revision b8a62b91)
1use crate::fd::OwnedFd;
2use crate::{backend, io};
3
4pub use backend::io::types::EventfdFlags;
5
6/// `eventfd(initval, flags)`—Creates a file descriptor for event
7/// notification.
8///
9/// # References
10///  - [Linux]
11///
12/// [Linux]: https://man7.org/linux/man-pages/man2/eventfd.2.html
13#[inline]
14pub fn eventfd(initval: u32, flags: EventfdFlags) -> io::Result<OwnedFd> {
15    backend::io::syscalls::eventfd(initval, flags)
16}
17