summaryrefslogtreecommitdiff
path: root/src/unix/solarish
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2021-01-22 04:21:43 +0000
committerPatrick Mooney <pmooney@oxide.computer>2021-01-22 04:21:43 +0000
commit5675256b8085ee93915e560ec4251f3a9915ecee (patch)
tree0d5b62595843ae70276f3b12d5f9f1faf5a2d23c /src/unix/solarish
parent7f11cdb191a7d78bc8e09583cec6b67589fe766e (diff)
downloadrust-libc-5675256b8085ee93915e560ec4251f3a9915ecee.tar.gz
Add timer interface for illumos and Solaris
Diffstat (limited to 'src/unix/solarish')
-rw-r--r--src/unix/solarish/mod.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index 0f53fe92dc..32a8525187 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -20,6 +20,7 @@ pub type rlim_t = ::c_ulong;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type time_t = ::c_long;
+pub type timer_t = ::c_int;
pub type wchar_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type projid_t = ::c_int;
@@ -120,6 +121,11 @@ s! {
pub ifa_data: *mut ::c_void
}
+ pub struct itimerspec {
+ pub it_interval: ::timespec,
+ pub it_value: ::timespec,
+ }
+
pub struct tm {
pub tm_sec: ::c_int,
pub tm_min: ::c_int,
@@ -2656,6 +2662,21 @@ extern "C" {
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+ pub fn timer_create(
+ clock_id: clockid_t,
+ evp: *mut sigevent,
+ timerid: *mut timer_t,
+ ) -> ::c_int;
+ pub fn timer_delete(timerid: timer_t) -> ::c_int;
+ pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+ pub fn timer_settime(
+ timerid: timer_t,
+ flags: ::c_int,
+ value: *const itimerspec,
+ ovalue: *mut itimerspec,
+ ) -> ::c_int;
+
pub fn ucred_get(pid: ::pid_t) -> *mut ucred_t;
pub fn getpeerucred(fd: ::c_int, ucred: *mut *mut ucred_t) -> ::c_int;