X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..143464d58d2bd6378e74eec636961ceb0d32fb91:/bsd/sys/time.h diff --git a/bsd/sys/time.h b/bsd/sys/time.h index 732d1ae76..fdf777617 100644 --- a/bsd/sys/time.h +++ b/bsd/sys/time.h @@ -68,36 +68,31 @@ #include #ifdef KERNEL #include /* user_time_t */ +#include /* uint64_t */ +#else /* !KERNEL */ +#include #endif /* KERNEL */ /* * [XSI] The fd_set type shall be defined as described in . * The timespec structure shall be defined as described in */ -#define __need_fd_set -#define __need_struct_timespec -#define __need_struct_timeval +#include +#include +#include #ifdef KERNEL -#define __need_struct_user_timespec -#define __need_struct_user32_timespec -#define __need_struct_user64_timespec -#define __need_struct_user_timeval -#define __need_struct_user32_timeval -#define __need_struct_user64_timeval -#define __need_struct_user32_itimerval -#define __need_struct_user64_itimerval +#include +#include +#include +#include +#include +#include +#include +#include #endif /* KERNEL */ -#include - -#ifndef _TIME_T -#define _TIME_T -typedef __darwin_time_t time_t; -#endif -#ifndef _SUSECONDS_T -#define _SUSECONDS_T -typedef __darwin_suseconds_t suseconds_t; -#endif +#include +#include /* * Structure used as a parameter by getitimer(2) and setitimer(2) system @@ -122,27 +117,15 @@ struct itimerval { * extra protection here is to permit application redefinition above * the default size. */ -#ifndef FD_SETSIZE -#define FD_SETSIZE __DARWIN_FD_SETSIZE -#endif /* FD_SETSIZE */ -#ifndef FD_SET -#define FD_SET(n, p) __DARWIN_FD_SET(n, p) -#endif /* FD_SET */ -#ifndef FD_CLR -#define FD_CLR(n,p) __DARWIN_FD_CLR(n, p) -#endif /* FD_CLR */ -#ifndef FD_ISSET -#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) -#endif /* FD_ISSET */ -#ifndef FD_ZERO -#define FD_ZERO(p) __DARWIN_FD_ZERO(p) -#endif /* FD_ZERO */ +#include +#include +#include +#include +#include #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#ifndef FD_COPY -#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) -#endif /* FD_COPY */ +#include #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ @@ -210,6 +193,7 @@ struct clockinfo { #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) __BEGIN_DECLS void microtime(struct timeval *tv); +void microtime_with_abstime(struct timeval *tv, uint64_t *abstime); void microuptime(struct timeval *tv); #define getmicrotime(a) microtime(a) #define getmicrouptime(a) microuptime(a) @@ -222,7 +206,9 @@ void timevalsub(struct timeval *t1, struct timeval *t2); void timevalfix(struct timeval *t1); #ifdef BSD_KERNEL_PRIVATE time_t boottime_sec(void); -void inittodr(time_t base) __attribute__((section("__TEXT, initcode"))); +void inittodr(time_t base); +int ratecheck(struct timeval *lasttime, const struct timeval *mininterval); +int ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps); #endif /* BSD_KERNEL_PRIVATE */ __END_DECLS @@ -240,7 +226,7 @@ __BEGIN_DECLS #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) int adjtime(const struct timeval *, struct timeval *); int futimes(int, const struct timeval *); -int lutimes(const char *, const struct timeval *); +int lutimes(const char *, const struct timeval *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); int settimeofday(const struct timeval *, const struct timezone *); #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */