File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ POSIX_FADV_RANDOM
1515POSIX_FADV_SEQUENTIAL
1616POSIX_FADV_WILLNEED
1717POSIX_SPAWN_SETSID
18+ TFD_CLOEXEC
19+ TFD_NONBLOCK
20+ TFD_TIMER_ABSTIME
21+ TFD_TIMER_CANCEL_ON_SET
1822posix_fadvise
1923posix_fallocate
2024posix_spawn_file_actions_addfchdir_np
@@ -23,3 +27,6 @@ pthread_attr_getstackaddr
2327pthread_attr_setstack
2428ptsname_r
2529syncfs
30+ timerfd_create
31+ timerfd_gettime
32+ timerfd_settime
Original file line number Diff line number Diff line change @@ -1042,6 +1042,10 @@ TCP_KEEPINIT
10421042TCP_KEEPINTVL
10431043TCP_MAXSEG
10441044TCP_MD5SIG
1045+ TFD_CLOEXEC
1046+ TFD_NONBLOCK
1047+ TFD_TIMER_ABSTIME
1048+ TFD_TIMER_CANCEL_ON_SET
10451049THOUSEP
10461050TIMER_ABSTIME
10471051TIME_DEL
@@ -1613,6 +1617,9 @@ timer_getoverrun
16131617timer_gettime
16141618timer_settime
16151619timer_t
1620+ timerfd_create
1621+ timerfd_gettime
1622+ timerfd_settime
16161623timex
16171624truncate
16181625ttyname_r
Original file line number Diff line number Diff line change @@ -2409,6 +2409,12 @@ pub const RTA_TAG: c_int = 0x100;
24092409pub const RTAX_TAG : c_int = 8 ;
24102410pub const RTAX_MAX : c_int = 9 ;
24112411
2412+ // sys/timerfd.h
2413+ pub const TFD_CLOEXEC : i32 = crate :: O_CLOEXEC ;
2414+ pub const TFD_NONBLOCK : i32 = crate :: O_NONBLOCK ;
2415+ pub const TFD_TIMER_ABSTIME : i32 = crate :: O_WRONLY ;
2416+ pub const TFD_TIMER_CANCEL_ON_SET : i32 = crate :: O_RDWR ;
2417+
24122418const_fn ! {
24132419 { const } fn _ALIGN( p: usize ) -> usize {
24142420 ( p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -2853,6 +2859,16 @@ extern "C" {
28532859 #[ link_name = "__getmntinfo13" ]
28542860 pub fn getmntinfo ( mntbufp : * mut * mut crate :: statvfs , flags : c_int ) -> c_int ;
28552861 pub fn getvfsstat ( buf : * mut statvfs , bufsize : size_t , flags : c_int ) -> c_int ;
2862+
2863+ // Added in `NetBSD` 10.0
2864+ pub fn timerfd_create ( clockid : crate :: clockid_t , flags : c_int ) -> c_int ;
2865+ pub fn timerfd_gettime ( fd : c_int , curr_value : * mut itimerspec ) -> c_int ;
2866+ pub fn timerfd_settime (
2867+ fd : c_int ,
2868+ flags : c_int ,
2869+ new_value : * const itimerspec ,
2870+ old_value : * mut itimerspec ,
2871+ ) -> c_int ;
28562872}
28572873
28582874#[ link( name = "rt" ) ]
Original file line number Diff line number Diff line change @@ -286,6 +286,12 @@ pub const B4000000: crate::speed_t = 31;
286286// sys/systeminfo.h
287287pub const SI_ADDRESS_WIDTH : c_int = 520 ;
288288
289+ // sys/timerfd.h
290+ pub const TFD_CLOEXEC : i32 = 0o2000000 ;
291+ pub const TFD_NONBLOCK : i32 = 0o4000 ;
292+ pub const TFD_TIMER_ABSTIME : i32 = 1 << 0 ;
293+ pub const TFD_TIMER_CANCEL_ON_SET : i32 = 1 << 1 ;
294+
289295extern "C" {
290296 pub fn eventfd ( init : c_uint , flags : c_int ) -> c_int ;
291297
@@ -353,4 +359,13 @@ extern "C" {
353359 n : size_t ,
354360 loc : crate :: locale_t ,
355361 ) -> c_int ;
362+
363+ pub fn timerfd_create ( clockid : c_int , flags : c_int ) -> c_int ;
364+ pub fn timerfd_gettime ( fd : c_int , curr_value : * mut crate :: itimerspec ) -> c_int ;
365+ pub fn timerfd_settime (
366+ fd : c_int ,
367+ flags : c_int ,
368+ new_value : * const crate :: itimerspec ,
369+ old_value : * mut crate :: itimerspec ,
370+ ) -> c_int ;
356371}
You can’t perform that action at this time.
0 commit comments