#include <sys/cdefs.h>
#include <sys/_types.h>
#ifdef __need_ucontext_t
#ifndef __need_struct_ucontext
#define __need_struct_ucontext
#endif
#endif
#ifdef __need_ucontext64_t
#ifndef __need_struct_ucontext64
#define __need_struct_ucontext64
#endif
#endif
#ifdef __need_struct_ucontext
#ifndef __need_struct_mcontext
#define __need_struct_mcontext
#endif
#endif
#ifdef __need_struct_ucontext64
#ifndef __need_struct_mcontext64
#define __need_struct_mcontext64
#endif
#endif
#if defined(__need_struct_mcontext) || defined(__need_struct_mcontext64)
#include <machine/_structs.h>
#endif
#if defined(__need_stack_t) || defined(__need_struct_ucontext) || defined(__need_struct_ucontext64)
#ifndef __need_struct_sigaltstack
#define __need_struct_sigaltstack
#endif
#endif
#ifdef __need_struct_sigaltstack
#undef __need_struct_sigaltstack
#ifndef _STRUCT_SIGALTSTACK
#if __DARWIN_UNIX03
#define _STRUCT_SIGALTSTACK struct __darwin_sigaltstack
#else
#define _STRUCT_SIGALTSTACK struct sigaltstack
#endif
_STRUCT_SIGALTSTACK
{
void *ss_sp;
__darwin_size_t ss_size;
int ss_flags;
};
#endif
#endif
#ifdef __need_struct_timespec
#undef __need_struct_timespec
#ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC struct timespec
_STRUCT_TIMESPEC
{
__darwin_time_t tv_sec;
long tv_nsec;
};
#endif
#endif
#ifdef __need_struct_timeval
#undef __need_struct_timeval
#ifndef _STRUCT_TIMEVAL
#define _STRUCT_TIMEVAL struct timeval
_STRUCT_TIMEVAL
{
__darwin_time_t tv_sec;
__darwin_suseconds_t tv_usec;
};
#endif
#endif
#ifdef __need_struct_timeval32
#undef __need_struct_timeval32
#ifndef _STRUCT_TIMEVAL32
#define _STRUCT_TIMEVAL32 struct timeval32
_STRUCT_TIMEVAL32
{
__int32_t tv_sec;
__int32_t tv_usec;
};
#endif
#endif
#ifdef __need_struct_ucontext
#undef __need_struct_ucontext
#ifndef _STRUCT_UCONTEXT
#if __DARWIN_UNIX03
#define _STRUCT_UCONTEXT struct __darwin_ucontext
#else
#define _STRUCT_UCONTEXT struct ucontext
#endif
_STRUCT_UCONTEXT
{
int uc_onstack;
__darwin_sigset_t uc_sigmask;
_STRUCT_SIGALTSTACK uc_stack;
_STRUCT_UCONTEXT *uc_link;
__darwin_size_t uc_mcsize;
_STRUCT_MCONTEXT *uc_mcontext;
#ifdef _XOPEN_SOURCE
_STRUCT_MCONTEXT __mcontext_data;
#endif
};
#endif
#endif
#ifdef __need_struct_ucontext64
#undef __need_struct_ucontext64
#ifndef _STRUCT_UCONTEXT64
#if __DARWIN_UNIX03
#define _STRUCT_UCONTEXT64 struct __darwin_ucontext64
#else
#define _STRUCT_UCONTEXT64 struct ucontext64
#endif
_STRUCT_UCONTEXT64
{
int uc_onstack;
__darwin_sigset_t uc_sigmask;
_STRUCT_SIGALTSTACK uc_stack;
_STRUCT_UCONTEXT64 *uc_link;
__darwin_size_t uc_mcsize;
_STRUCT_MCONTEXT64 *uc_mcontext64;
};
#endif
#endif
#ifdef KERNEL
#ifdef __need_struct_user_timespec
#undef __need_struct_user_timespec
#ifndef _STRUCT_USER_TIMESPEC
#define _STRUCT_USER_TIMESPEC struct user_timespec
_STRUCT_USER_TIMESPEC
{
user_time_t tv_sec;
user_long_t tv_nsec;
};
#endif
#endif
#ifdef __need_struct_user64_timespec
#undef __need_struct_user64_timespec
#ifndef _STRUCT_USER64_TIMESPEC
#define _STRUCT_USER64_TIMESPEC struct user64_timespec
_STRUCT_USER64_TIMESPEC
{
user64_time_t tv_sec;
user64_long_t tv_nsec;
};
#endif
#endif
#ifdef __need_struct_user32_timespec
#undef __need_struct_user32_timespec
#ifndef _STRUCT_USER32_TIMESPEC
#define _STRUCT_USER32_TIMESPEC struct user32_timespec
_STRUCT_USER32_TIMESPEC
{
user32_time_t tv_sec;
user32_long_t tv_nsec;
};
#endif
#endif
#ifdef __need_struct_user_timeval
#undef __need_struct_user_timeval
#ifndef _STRUCT_USER_TIMEVAL
#define _STRUCT_USER_TIMEVAL struct user_timeval
_STRUCT_USER_TIMEVAL
{
user_time_t tv_sec;
__int32_t tv_usec;
};
#endif
#endif
#ifdef __need_struct_user64_timeval
#undef __need_struct_user64_timeval
#ifndef _STRUCT_USER64_TIMEVAL
#define _STRUCT_USER64_TIMEVAL struct user64_timeval
_STRUCT_USER64_TIMEVAL
{
user64_time_t tv_sec;
__int32_t tv_usec;
};
#endif
#endif
#ifdef __need_struct_user32_timeval
#undef __need_struct_user32_timeval
#ifndef _STRUCT_USER32_TIMEVAL
#define _STRUCT_USER32_TIMEVAL struct user32_timeval
_STRUCT_USER32_TIMEVAL
{
user32_time_t tv_sec;
__int32_t tv_usec;
};
#endif
#endif
#ifdef __need_struct_user64_itimerval
#undef __need_struct_user64_itimerval
#ifndef _STRUCT_USER64_ITIMERVAL
#define _STRUCT_USER64_ITIMERVAL struct user64_itimerval
_STRUCT_USER64_ITIMERVAL
{
_STRUCT_USER64_TIMEVAL it_interval;
_STRUCT_USER64_TIMEVAL it_value;
};
#endif
#endif
#ifdef __need_struct_user32_itimerval
#undef __need_struct_user32_itimerval
#ifndef _STRUCT_USER32_ITIMERVAL
#define _STRUCT_USER32_ITIMERVAL struct user32_itimerval
_STRUCT_USER32_ITIMERVAL
{
_STRUCT_USER32_TIMEVAL it_interval;
_STRUCT_USER32_TIMEVAL it_value;
};
#endif
#endif
#endif
#ifdef __need_fd_set
#undef __need_fd_set
#ifndef _FD_SET
#define _FD_SET
#ifdef FD_SETSIZE
#define __DARWIN_FD_SETSIZE FD_SETSIZE
#else
#define __DARWIN_FD_SETSIZE 1024
#endif
#define __DARWIN_NBBY 8
#define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY)
#define __DARWIN_howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1))
__BEGIN_DECLS
typedef struct fd_set {
__int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)];
} fd_set;
__END_DECLS
static __inline int
__darwin_fd_isset(int _n, const struct fd_set *_p)
{
return (_p->fds_bits[_n/__DARWIN_NFDBITS] & (1<<(_n % __DARWIN_NFDBITS)));
}
#define __DARWIN_FD_SET(n, p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] |= (1<<(__fd % __DARWIN_NFDBITS))); } while(0)
#define __DARWIN_FD_CLR(n, p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] &= ~(1<<(__fd % __DARWIN_NFDBITS))); } while(0)
#define __DARWIN_FD_ISSET(n, p) __darwin_fd_isset((n), (p))
#if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3
#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p)))
#else
#define __DARWIN_FD_ZERO(p) bzero(p, sizeof(*(p)))
#endif
#define __DARWIN_FD_COPY(f, t) bcopy(f, t, sizeof(*(f)))
#endif
#endif
#ifdef __need_stack_t
#undef __need_stack_t
#ifndef _STACK_T
#define _STACK_T
typedef _STRUCT_SIGALTSTACK stack_t;
#endif
#endif
#ifdef __need_ucontext_t
#undef __need_ucontext_t
#ifndef _UCONTEXT_T
#define _UCONTEXT_T
typedef _STRUCT_UCONTEXT ucontext_t;
#endif
#endif
#ifdef __need_ucontext64_t
#undef __need_ucontext64_t
#ifndef _UCONTEXT64_T
#define _UCONTEXT64_T
typedef _STRUCT_UCONTEXT64 ucontext64_t;
#endif
#endif