Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timer interface for illumos and Solaris #2041

Merged
merged 1 commit into from Jan 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/unix/solarish/mod.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down