Skip to content

Commit 5675256

Browse files
committed
Add timer interface for illumos and Solaris
1 parent 7f11cdb commit 5675256

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/unix/solarish/mod.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub type rlim_t = ::c_ulong;
2020
pub type speed_t = ::c_uint;
2121
pub type tcflag_t = ::c_uint;
2222
pub type time_t = ::c_long;
23+
pub type timer_t = ::c_int;
2324
pub type wchar_t = ::c_int;
2425
pub type nfds_t = ::c_ulong;
2526
pub type projid_t = ::c_int;
@@ -120,6 +121,11 @@ s! {
120121
pub ifa_data: *mut ::c_void
121122
}
122123

124+
pub struct itimerspec {
125+
pub it_interval: ::timespec,
126+
pub it_value: ::timespec,
127+
}
128+
123129
pub struct tm {
124130
pub tm_sec: ::c_int,
125131
pub tm_min: ::c_int,
@@ -2656,6 +2662,21 @@ extern "C" {
26562662
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
26572663
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
26582664

2665+
pub fn timer_create(
2666+
clock_id: clockid_t,
2667+
evp: *mut sigevent,
2668+
timerid: *mut timer_t,
2669+
) -> ::c_int;
2670+
pub fn timer_delete(timerid: timer_t) -> ::c_int;
2671+
pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
2672+
pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
2673+
pub fn timer_settime(
2674+
timerid: timer_t,
2675+
flags: ::c_int,
2676+
value: *const itimerspec,
2677+
ovalue: *mut itimerspec,
2678+
) -> ::c_int;
2679+
26592680
pub fn ucred_get(pid: ::pid_t) -> *mut ucred_t;
26602681
pub fn getpeerucred(fd: ::c_int, ucred: *mut *mut ucred_t) -> ::c_int;
26612682

0 commit comments

Comments
 (0)