Skip to content
Snippets Groups Projects
Unverified Commit c44fece7 authored by Yuki Okushi's avatar Yuki Okushi Committed by GitHub
Browse files

Merge pull request #1885 from MeiK2333/master

Add getitimer and setitimer for macOS
parents af7749c1 7cc22dba
No related branches found
No related tags found
Loading
...@@ -506,6 +506,10 @@ pub const PRIO_PROCESS: ::c_int = 0; ...@@ -506,6 +506,10 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1; pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2; 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! { f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() { if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
...@@ -849,6 +853,23 @@ extern "C" { ...@@ -849,6 +853,23 @@ extern "C" {
options: ::c_int, options: ::c_int,
rusage: *mut ::rusage, rusage: *mut ::rusage,
) -> ::pid_t; ) -> ::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( pub fn regcomp(
preg: *mut regex_t, 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