Skip to content

Commit e976c37

Browse files
author
Andrew Salmon
committed
add getitimer and setitimer
also struct itimerval, which is necessary for the implementation
1 parent 7efffc1 commit e976c37

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/unix/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ s! {
124124
// Actually a union of an int and a void*
125125
pub sival_ptr: *mut ::c_void
126126
}
127+
128+
pub struct itimerval {
129+
pub it_interval: ::timeval,
130+
pub it_value: ::timeval,
131+
}
127132
}
128133

129134
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
@@ -565,6 +570,12 @@ extern {
565570

566571
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
567572

573+
#[cfg_attr(target_os = "netbsd", link_name = "__getitimer50")]
574+
pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
575+
#[cfg_attr(target_os = "netbsd", link_name = "__setitimer50")]
576+
pub fn setitimer(which: ::c_int,
577+
new_value: *::itimerval,
578+
old_value: *::itimerval) -> ::c_int;
568579
#[cfg_attr(target_os = "netbsd", link_name = "__gettimeofday50")]
569580
pub fn gettimeofday(tp: *mut ::timeval,
570581
tz: *mut ::c_void) -> ::c_int;

0 commit comments

Comments
 (0)