File tree 5 files changed +78
-16
lines changed
5 files changed +78
-16
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ pub type speed_t = ::c_uint;
13
13
pub type nl_item = :: c_int ;
14
14
pub type id_t = i64 ;
15
15
pub type vm_size_t = :: uintptr_t ;
16
+ pub type timer_t = * mut :: c_void ;
16
17
17
18
#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
18
19
pub enum timezone { }
@@ -233,6 +234,11 @@ s! {
233
234
pub piod_addr: * mut :: c_void,
234
235
pub piod_len: :: size_t,
235
236
}
237
+
238
+ pub struct itimerspec {
239
+ pub it_interval: :: timespec,
240
+ pub it_value: :: timespec,
241
+ }
236
242
}
237
243
238
244
s_no_extra_traits ! {
@@ -1566,6 +1572,24 @@ extern "C" {
1566
1572
abs_timeout : * const :: timespec ,
1567
1573
) -> :: c_int ;
1568
1574
pub fn mq_unlink ( name : * const :: c_char ) -> :: c_int ;
1575
+
1576
+ pub fn timer_create (
1577
+ clockid : :: clock_t ,
1578
+ sevp : * mut :: sigevent ,
1579
+ timerid : * mut :: timer_t ,
1580
+ ) -> :: c_int ;
1581
+ pub fn timer_settime (
1582
+ timerid : :: timer_t ,
1583
+ flags : :: c_int ,
1584
+ new_value : * const :: itimerspec ,
1585
+ old_value : * mut :: itimerspec ,
1586
+ ) -> :: c_int ;
1587
+ pub fn timer_gettime (
1588
+ timerid : :: timer_t ,
1589
+ curr_value : * mut :: itimerspec ,
1590
+ ) -> :: c_int ;
1591
+ pub fn timer_getoverrun ( timerid : :: timer_t ) -> :: c_int ;
1592
+ pub fn timer_delete ( timerid : :: timer_t ) -> :: c_int ;
1569
1593
}
1570
1594
1571
1595
#[ link( name = "util" ) ]
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ type __pthread_spin_t = __cpu_simple_lock_nv_t;
10
10
pub type vm_size_t = :: uintptr_t ;
11
11
pub type lwpid_t = :: c_uint ;
12
12
pub type shmatt_t = :: c_uint ;
13
+ pub type timer_t = * mut :: c_void ;
13
14
14
15
impl siginfo_t {
15
16
pub unsafe fn si_value ( & self ) -> :: sigval {
@@ -341,6 +342,11 @@ s! {
341
342
pub time_state: :: c_int,
342
343
}
343
344
345
+ pub struct itimerspec {
346
+ pub it_interval: :: timespec,
347
+ pub it_value: :: timespec,
348
+ }
349
+
344
350
}
345
351
346
352
s_no_extra_traits ! {
@@ -1759,6 +1765,24 @@ extern "C" {
1759
1765
nitems : :: c_int ,
1760
1766
sevp : * mut sigevent ,
1761
1767
) -> :: c_int ;
1768
+
1769
+ pub fn timer_create (
1770
+ clockid : :: clock_t ,
1771
+ sevp : * mut :: sigevent ,
1772
+ timerid : * mut :: timer_t ,
1773
+ ) -> :: c_int ;
1774
+ pub fn timer_settime (
1775
+ timerid : :: timer_t ,
1776
+ flags : :: c_int ,
1777
+ new_value : * const :: itimerspec ,
1778
+ old_value : * mut :: itimerspec ,
1779
+ ) -> :: c_int ;
1780
+ pub fn timer_gettime (
1781
+ timerid : :: timer_t ,
1782
+ curr_value : * mut :: itimerspec ,
1783
+ ) -> :: c_int ;
1784
+ pub fn timer_getoverrun ( timerid : :: timer_t ) -> :: c_int ;
1785
+ pub fn timer_delete ( timerid : :: timer_t ) -> :: c_int ;
1762
1786
}
1763
1787
1764
1788
extern "C" {
Original file line number Diff line number Diff line change @@ -148,11 +148,6 @@ s! {
148
148
_pad: [ u8 ; 28 ] ,
149
149
}
150
150
151
- pub struct itimerspec {
152
- pub it_interval: :: timespec,
153
- pub it_value: :: timespec,
154
- }
155
-
156
151
pub struct ucred {
157
152
pub pid: :: pid_t,
158
153
pub uid: :: uid_t,
@@ -2465,13 +2460,13 @@ extern "C" {
2465
2460
pub fn timerfd_create ( clock : :: clockid_t , flags : :: c_int ) -> :: c_int ;
2466
2461
pub fn timerfd_gettime (
2467
2462
fd : :: c_int ,
2468
- current_value : * mut itimerspec ,
2463
+ current_value : * mut :: itimerspec ,
2469
2464
) -> :: c_int ;
2470
2465
pub fn timerfd_settime (
2471
2466
fd : :: c_int ,
2472
2467
flags : :: c_int ,
2473
- new_value : * const itimerspec ,
2474
- old_value : * mut itimerspec ,
2468
+ new_value : * const :: itimerspec ,
2469
+ old_value : * mut :: itimerspec ,
2475
2470
) -> :: c_int ;
2476
2471
pub fn syscall ( num : :: c_long , ...) -> :: c_long ;
2477
2472
pub fn sched_getaffinity (
Original file line number Diff line number Diff line change @@ -123,11 +123,6 @@ s! {
123
123
_pad: [ u8 ; 28 ] ,
124
124
}
125
125
126
- pub struct itimerspec {
127
- pub it_interval: :: timespec,
128
- pub it_value: :: timespec,
129
- }
130
-
131
126
pub struct fsid_t {
132
127
__val: [ :: c_int; 2 ] ,
133
128
}
@@ -2951,13 +2946,13 @@ extern "C" {
2951
2946
pub fn timerfd_create ( clockid : :: c_int , flags : :: c_int ) -> :: c_int ;
2952
2947
pub fn timerfd_gettime (
2953
2948
fd : :: c_int ,
2954
- curr_value : * mut itimerspec ,
2949
+ curr_value : * mut :: itimerspec ,
2955
2950
) -> :: c_int ;
2956
2951
pub fn timerfd_settime (
2957
2952
fd : :: c_int ,
2958
2953
flags : :: c_int ,
2959
- new_value : * const itimerspec ,
2960
- old_value : * mut itimerspec ,
2954
+ new_value : * const :: itimerspec ,
2955
+ old_value : * mut :: itimerspec ,
2961
2956
) -> :: c_int ;
2962
2957
pub fn pwritev (
2963
2958
fd : :: c_int ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ pub type tcflag_t = ::c_uint;
4
4
pub type clockid_t = :: c_int ;
5
5
pub type key_t = :: c_int ;
6
6
pub type id_t = :: c_uint ;
7
+ pub type timer_t = * mut :: c_void ;
7
8
8
9
#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
9
10
pub enum timezone { }
@@ -201,6 +202,11 @@ s! {
201
202
pub msg_hdr: :: msghdr,
202
203
pub msg_len: :: c_uint,
203
204
}
205
+
206
+ pub struct itimerspec {
207
+ pub it_interval: :: timespec,
208
+ pub it_value: :: timespec,
209
+ }
204
210
}
205
211
206
212
s_no_extra_traits ! {
@@ -1566,6 +1572,24 @@ extern "C" {
1566
1572
flags : :: c_int ,
1567
1573
) -> :: ssize_t ;
1568
1574
pub fn uname ( buf : * mut :: utsname ) -> :: c_int ;
1575
+
1576
+ pub fn timer_create (
1577
+ clockid : :: clock_t ,
1578
+ sevp : * mut :: sigevent ,
1579
+ timerid : * mut :: timer_t ,
1580
+ ) -> :: c_int ;
1581
+ pub fn timer_settime (
1582
+ timerid : :: timer_t ,
1583
+ flags : :: c_int ,
1584
+ new_value : * const :: itimerspec ,
1585
+ old_value : * mut :: itimerspec ,
1586
+ ) -> :: c_int ;
1587
+ pub fn timer_gettime (
1588
+ timerid : :: timer_t ,
1589
+ curr_value : * mut :: itimerspec ,
1590
+ ) -> :: c_int ;
1591
+ pub fn timer_getoverrun ( timerid : :: timer_t ) -> :: c_int ;
1592
+ pub fn timer_delete ( timerid : :: timer_t ) -> :: c_int ;
1569
1593
}
1570
1594
1571
1595
cfg_if ! {
You can’t perform that action at this time.
0 commit comments