Skip to content
Snippets Groups Projects
Commit 7cc22dba authored by MeiK's avatar MeiK
Browse files

Add getitimer and setitimer for macOS

Add getitimer and setitimer for macOS
parent af7749c1
No related branches found
No related tags found
No related merge requests found
......@@ -506,6 +506,10 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
......@@ -849,6 +853,23 @@ extern "C" {
options: ::c_int,
rusage: *mut ::rusage,
) -> ::pid_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "getitimer$UNIX2003"
)]
pub fn getitimer(
which: ::c_int,
curr_value: *mut ::itimerval
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "setitimer$UNIX2003"
)]
pub fn setitimer(
which: ::c_int,
new_value: *const ::itimerval,
old_value: *mut ::itimerval,
) -> ::c_int;
pub fn regcomp(
preg: *mut regex_t,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment