|
1 | 1 | use crate::prelude::*; |
2 | | -use crate::{ |
3 | | - cmsghdr, |
4 | | - cpuid_t, |
5 | | - lwpid_t, |
6 | | - off_t, |
7 | | -}; |
| 2 | +use crate::{cmsghdr, cpuid_t, lwpid_t, off_t}; |
8 | 3 |
|
9 | 4 | pub type blksize_t = i32; |
| 5 | +pub type eventfd_t = u64; |
10 | 6 | pub type fsblkcnt_t = u64; |
11 | 7 | pub type fsfilcnt_t = u64; |
12 | 8 | pub type idtype_t = c_int; |
@@ -1742,6 +1738,11 @@ pub const RTA_TAG: c_int = 0x100; |
1742 | 1738 | pub const RTAX_TAG: c_int = 8; |
1743 | 1739 | pub const RTAX_MAX: c_int = 9; |
1744 | 1740 |
|
| 1741 | +// For eventfd |
| 1742 | +pub const EFD_SEMAPHORE: c_int = crate::O_RDWR; |
| 1743 | +pub const EFD_NONBLOCK: c_int = crate::O_NONBLOCK; |
| 1744 | +pub const EFD_CLOEXEC: c_int = crate::O_CLOEXEC; |
| 1745 | + |
1745 | 1746 | // sys/timerfd.h |
1746 | 1747 | pub const TFD_CLOEXEC: i32 = crate::O_CLOEXEC; |
1747 | 1748 | pub const TFD_NONBLOCK: i32 = crate::O_NONBLOCK; |
@@ -2197,6 +2198,10 @@ extern "C" { |
2197 | 2198 | pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int; |
2198 | 2199 | pub fn getvfsstat(buf: *mut crate::statvfs, bufsize: size_t, flags: c_int) -> c_int; |
2199 | 2200 |
|
| 2201 | + pub fn eventfd(init: c_uint, flags: c_int) -> c_int; |
| 2202 | + pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int; |
| 2203 | + pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int; |
| 2204 | + |
2200 | 2205 | // Added in `NetBSD` 10.0 |
2201 | 2206 | pub fn timerfd_create(clockid: crate::clockid_t, flags: c_int) -> c_int; |
2202 | 2207 | pub fn timerfd_gettime(fd: c_int, curr_value: *mut crate::itimerspec) -> c_int; |
|
0 commit comments