1.0.10.36: support for Darwin versions that support __DARWIN_UNIX03
[sbcl.git] / src / runtime / darwin-os.h
1 #ifndef _DARWIN_OS_H
2 #define _DARWIN_OS_H
3
4 /* this is meant to be included from bsd-os.h */
5
6 #include <mach/mach_init.h>
7 #include <mach/task.h>
8
9 /* man pages claim that the third argument is a sigcontext struct,
10    but ucontext_t is defined, matches sigcontext where sensible,
11    offers better access to mcontext, and is of course the SUSv2-
12    mandated type of the third argument, so we use that instead.
13    If Apple is going to break ucontext_t out of spite, I'm going
14    to be cross with them ;) -- PRM */
15
16 #if defined(LISP_FEATURE_X86)
17 #include <sys/ucontext.h>
18 #include <sys/_types.h>
19 #if __DARWIN_UNIX03
20 typedef struct __darwin_ucontext os_context_t;
21 #else
22 typedef struct ucontext os_context_t;
23 #endif
24
25
26 #else
27 #include <ucontext.h>
28 typedef ucontext_t os_context_t;
29 #endif
30
31 #define SIG_MEMORY_FAULT SIGBUS
32
33 #define SIG_INTERRUPT_THREAD (SIGINFO)
34 #define SIG_STOP_FOR_GC (SIGUSR1)
35 #define SIG_RESUME_FROM_GC (SIGUSR2)
36
37 #endif /* _DARWIN_OS_H */