+union sigval {
+ /* Members as suggested by Annex C of POSIX 1003.1b. */
+ int sigval_int;
+ void *sigval_ptr;
+};
+
+#define SIGEV_NONE 0 /* No async notification */
+#ifdef __APPLE_API_PRIVATE
+#define SIGEV_SIGNAL 1 /* Generate a queued signal */
+#define SIGEV_THREAD 3 /* A notification function will be called to perfrom notification */
+#endif /*__APPLE_API_PRIVATE */
+
+typedef struct __siginfo {
+ int si_signo; /* signal number */
+ int si_errno; /* errno association */
+ int si_code; /* signal code */
+ int si_pid; /* sending process */
+ unsigned int si_uid; /* sender's ruid */
+ int si_status; /* exit value */
+ void *si_addr; /* faulting instruction */
+ union sigval si_value; /* signal value */
+ long si_band; /* band event for SIGPOLL */
+ int pad[7]; /* RFU */
+} siginfo_t;
+
+/*
+ * Incase of SIGILL and SIGFPE, si_addr contains the address of
+ * faulting instruction.
+ * Incase of SIGSEGV and SIGBUS, si_addr contains address of
+ * faulting memory reference.
+ * Incase of SIGCHLD, si_pid willhave child process ID,
+ * si_status will contain exit value or signal.
+ * si_uid contains real user ID of the process that sent the signal
+ */
+
+/* Values for si_code */
+
+/* Codes for SIGILL */
+#define ILL_NOOP 0 /* if only I knew... */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLTRP 2 /* illegal trap */
+#define ILL_PRVOPC 3 /* privileged opcode */
+
+/* Codes for SIGFPE */
+#define FPE_NOOP 0 /* if only I knew... */
+#define FPE_FLTDIV 1 /* floating point divide by zero */
+#define FPE_FLTOVF 2 /* floating point overflow */
+#define FPE_FLTUND 3 /* floating point underflow */
+#define FPE_FLTRES 4 /* floating point inexact result */
+#define FPE_FLTINV 5 /* invalid floating point operation */
+
+/* Codes for SIGSEGV */
+#define SEGV_NOOP 0 /* if only I knew... */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SEGV_ACCERR 2 /* invalid permissions for mapped to object */
+
+/* Codes for SIGBUS */
+#define BUS_NOOP 0 /* if only I knew... */
+#define BUS_ADRALN 1 /* invalid address alignment */
+
+/* Codes for SIGCHLD */
+#define CLD_NOOP 0 /* if only I knew... */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2
+ /* child has terminated abnormally and did not create a core file */
+#define CLD_DUMPED 3
+ /* child has terminated abnormally and create a core file */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+
+/* union for signal handlers */
+union __sigaction_u {
+ void (*__sa_handler)(int);
+ void (*__sa_sigaction)(int, struct __siginfo *,
+ void *);
+};
+
+/* Signal vector template for Kernel user boundary */
+struct __sigaction {
+ union __sigaction_u __sigaction_u; /* signal handler */
+ void (*sa_tramp)(void *, int, int, siginfo_t *, void *);
+ sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+