#ifndef _ANSI_SOURCE
#include <sys/_types.h>
-#define __need_mcontext_t
-#define __need_stack_t
-#define __need_ucontext_t
-#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
-#if defined(__ppc__) || defined(__ppc64__)
-#define __need_mcontext64_t
-#define __need_ucontext64_t
-#endif /* __ppc__ || __ppc64__ */
-#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
-#include <sys/_structs.h>
-
-#ifndef _PID_T
-#define _PID_T
-typedef __darwin_pid_t pid_t;
-#endif
+#include <machine/_mcontext.h>
-#ifndef _PTHREAD_ATTR_T
-#define _PTHREAD_ATTR_T
-typedef __darwin_pthread_attr_t pthread_attr_t;
-#endif
+#ifndef KERNEL
+#include <sys/_pthread/_pthread_attr_t.h>
+#endif /* KERNEL */
-#ifndef _SIGSET_T
-#define _SIGSET_T
-typedef __darwin_sigset_t sigset_t;
-#endif
+#include <sys/_types/_sigaltstack.h>
+#include <sys/_types/_ucontext.h>
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef __darwin_size_t size_t;
-#endif
-
-#ifndef _UID_T
-#define _UID_T
-typedef __darwin_uid_t uid_t;
-#endif
+#include <sys/_types/_pid_t.h>
+#include <sys/_types/_sigset_t.h>
+#include <sys/_types/_size_t.h>
+#include <sys/_types/_uid_t.h>
union sigval {
/* Members as suggested by Annex C of POSIX 1003.1b. */
void *sival_ptr;
};
-#define SIGEV_NONE 0 /* No async notification */
-#define SIGEV_SIGNAL 1 /* aio - completion notification */
-#define SIGEV_THREAD 3 /* A notification function will be called to perform notification */
+#define SIGEV_NONE 0 /* No async notification */
+#define SIGEV_SIGNAL 1 /* aio - completion notification */
+#define SIGEV_THREAD 3 /* [NOTIMP] [RTS] call notification function */
+#ifndef KERNEL
struct sigevent {
int sigev_notify; /* Notification type */
int sigev_signo; /* Signal number */
void (*sigev_notify_function)(union sigval); /* Notification function */
pthread_attr_t *sigev_notify_attributes; /* Notification attributes */
};
+#endif /* KERNEL */
#ifdef BSD_KERNEL_PRIVATE
+union user64_sigval {
+ struct {
+ uint32_t pad; /* assumes Motorola byte order */
+ int32_t sival_int;
+ } size_equivalent;
+ user64_addr_t sival_ptr;
+};
+
+union user32_sigval {
+ /* Members as suggested by Annex C of POSIX 1003.1b. */
+ int32_t sival_int;
+ user32_addr_t sival_ptr;
+};
+
union user_sigval {
struct {
- int pad; /* assumes Motorolla byte order */
- int sival_int;
+ uint32_t pad; /* assumes Motorola byte order */
+ int32_t sival_int;
} size_equivalent;
- user_addr_t sival_ptr;
+ user_addr_t sival_ptr;
+};
+
+struct user64_sigevent {
+ int sigev_notify; /* Notification type */
+ int sigev_signo; /* Signal number */
+ union user64_sigval sigev_value; /* Signal value */
+ user64_addr_t sigev_notify_function; /* Notify function */
+ user64_addr_t sigev_notify_attributes; /* Notify attributes */
+};
+
+struct user32_sigevent {
+ int sigev_notify; /* Notification type */
+ int sigev_signo; /* Signal number */
+ union user32_sigval sigev_value; /* Signal value */
+ user32_addr_t sigev_notify_function; /* Notify function */
+ user32_addr_t sigev_notify_attributes; /* Notify attributes */
};
struct user_sigevent {
#ifdef BSD_KERNEL_PRIVATE
-typedef struct __user_siginfo {
+typedef struct user_siginfo {
int si_signo; /* signal number */
int si_errno; /* errno association */
int si_code; /* signal code */
user_ulong_t pad[7]; /* Reserved for Future Use */
} user_siginfo_t;
+typedef struct user64_siginfo {
+ int si_signo; /* signal number */
+ int si_errno; /* errno association */
+ int si_code; /* signal code */
+ pid_t si_pid; /* sending process */
+ uid_t si_uid; /* sender's ruid */
+ int si_status; /* exit value */
+ user64_addr_t si_addr; /* faulting instruction (see below) */
+ union user64_sigval si_value; /* signal value */
+ user64_long_t si_band; /* band event for SIGPOLL */
+ user64_ulong_t __pad[7]; /* Reserved for Future Use */
+} user64_siginfo_t;
+
+typedef struct user32_siginfo {
+ int si_signo; /* signal number */
+ int si_errno; /* errno association */
+ int si_code; /* signal code */
+ pid_t si_pid; /* sending process */
+ uid_t si_uid; /* sender's ruid */
+ int si_status; /* exit value */
+ user32_addr_t si_addr; /* faulting instruction (see below) */
+ union user32_sigval si_value; /* signal value */
+ user32_long_t si_band; /* band event for SIGPOLL */
+ user32_ulong_t __pad[7]; /* Reserved for Future Use */
+} user32_siginfo_t;
+
+void siginfo_user_to_user32(user_siginfo_t *, user32_siginfo_t *);
+void siginfo_user_to_user64(user_siginfo_t *, user64_siginfo_t *);
+
#endif /* BSD_KERNEL_PRIVATE */
/*
#define FPE_FLTRES 4 /* [XSI] floating point inexact result */
#define FPE_FLTINV 5 /* [XSI] invalid floating point operation */
#define FPE_FLTSUB 6 /* [XSI] subscript out of range -NOTIMP */
-#define FPE_INTDIV 7 /* [XSI] integer divide by zero -NOTIMP */
-#define FPE_INTOVF 8 /* [XSI] integer overflow -NOTIMP */
+#define FPE_INTDIV 7 /* [XSI] integer divide by zero */
+#define FPE_INTOVF 8 /* [XSI] integer overflow */
/* Codes for SIGSEGV */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#ifdef BSD_KERNEL_PRIVATE
#include <machine/types.h>
-union __user_sigaction_u {
+union __user32_sigaction_u {
+ user32_addr_t __sa_handler;
+ user32_addr_t __sa_sigaction;
+};
+
+struct user32_sigaction {
+ union __user32_sigaction_u __sigaction_u; /* signal handler */
+ sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+
+struct __user32_sigaction {
+ union __user32_sigaction_u __sigaction_u; /* signal handler */
+ user32_addr_t sa_tramp;
+ sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+
+union __user64_sigaction_u {
+ user64_addr_t __sa_handler;
+ user64_addr_t __sa_sigaction;
+};
+
+struct user64_sigaction {
+ union __user64_sigaction_u __sigaction_u; /* signal handler */
+ sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+
+struct __user64_sigaction {
+ union __user64_sigaction_u __sigaction_u; /* signal handler */
+ user64_addr_t sa_tramp; /* signal mask to apply */
+ sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+
+union __kern_sigaction_u {
user_addr_t __sa_handler;
user_addr_t __sa_sigaction;
};
-struct user_sigaction {
- union __user_sigaction_u __sigaction_u; /* signal handler */
+struct kern_sigaction {
+ union __kern_sigaction_u __sigaction_u; /* signal handler */
sigset_t sa_mask; /* signal mask to apply */
int sa_flags; /* see signal options below */
};
-struct __user_sigaction {
- union __user_sigaction_u __sigaction_u; /* signal handler */
+struct __kern_sigaction {
+ union __kern_sigaction_u __sigaction_u; /* signal handler */
user_addr_t sa_tramp; /* signal mask to apply */
sigset_t sa_mask; /* signal mask to apply */
int sa_flags; /* see signal options below */
*/
#ifdef BSD_KERNEL_PRIVATE
-struct user_sigaltstack {
+struct user32_sigaltstack {
+ user32_addr_t ss_sp; /* signal stack base */
+ user32_size_t ss_size; /* signal stack length */
+ int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */
+};
+
+struct user64_sigaltstack {
+ user64_addr_t ss_sp; /* signal stack base */
+ user64_size_t ss_size; /* signal stack length */
+ int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */
+};
+
+struct kern_sigaltstack {
user_addr_t ss_sp; /* signal stack base */
user_size_t ss_size; /* signal stack length */
- int ss_flags __attribute((aligned(8))); /* SA_DISABLE and/or SA_ONSTACK */
+ int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */
};
#endif /* BSD_KERNEL_PRIVATE */
*/
#define sigmask(m) (1 << ((m)-1))
-#ifdef BSD_KERNEL_PRIVATE
+#ifdef KERNEL_PRIVATE
/*
* signals delivered on a per-thread basis.
*/
sigmask(SIGIOT)|sigmask(SIGEMT)|\
sigmask(SIGFPE)|sigmask(SIGBUS)|\
sigmask(SIGSEGV)|sigmask(SIGSYS)|\
- sigmask(SIGPIPE))
-#endif /* BSD_KERNEL_PRIVATE */
+ sigmask(SIGPIPE)|sigmask(SIGKILL))
+
+#define workq_threadmask (threadmask | sigcantmask)
+
+/*
+ * Signals carried across exec.
+ */
+#define execmask (sigmask(SIGHUP)|sigmask(SIGINT)|\
+ sigmask(SIGQUIT)|sigmask(SIGKILL)|\
+ sigmask(SIGTERM)|sigmask(SIGSTOP)|\
+ sigmask(SIGTSTP)|sigmask(SIGCONT)|\
+ sigmask(SIGTTIN)|sigmask(SIGTTOU)|\
+ sigmask(SIGUSR1)|sigmask(SIGUSR2))
+
+#endif /* KERNEL_PRIVATE */
#define BADSIG SIG_ERR