| 1 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 2 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 3 | |
| 4 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 5 | #define MINSIGSTKSZ 4096 |
| 6 | #define SIGSTKSZ 10240 |
| 7 | #endif |
| 8 | |
| 9 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 10 | |
| 11 | typedef unsigned long greg_t, gregset_t[27]; |
| 12 | |
| 13 | typedef struct { |
| 14 | 	unsigned long mask; |
| 15 | 	unsigned long addr; |
| 16 | } __psw_t; |
| 17 | |
| 18 | typedef union { |
| 19 | 	double d; |
| 20 | 	float f; |
| 21 | } fpreg_t; |
| 22 | |
| 23 | typedef struct { |
| 24 | 	unsigned fpc; |
| 25 | 	fpreg_t fprs[16]; |
| 26 | } fpregset_t; |
| 27 | |
| 28 | typedef struct |
| 29 | { |
| 30 | 	__psw_t psw; |
| 31 | 	unsigned long gregs[16]; |
| 32 | 	unsigned aregs[16]; |
| 33 | 	fpregset_t fpregs; |
| 34 | } mcontext_t; |
| 35 | |
| 36 | struct sigcontext { |
| 37 | 	unsigned long oldmask[1]; |
| 38 | 	struct { |
| 39 | 		struct { |
| 40 | 			__psw_t psw; |
| 41 | 			unsigned long gprs[16]; |
| 42 | 			unsigned acrs[16]; |
| 43 | 		} regs; |
| 44 | 		struct { |
| 45 | 			unsigned fpc; |
| 46 | 			double fprs[16]; |
| 47 | 		} fpregs; |
| 48 | 	} *sregs; |
| 49 | }; |
| 50 | |
| 51 | #else |
| 52 | |
| 53 | typedef struct { |
| 54 | 	unsigned long __regs1[18]; |
| 55 | 	unsigned __regs2[18]; |
| 56 | 	double __regs3[16]; |
| 57 | } mcontext_t; |
| 58 | |
| 59 | #endif |
| 60 | |
| 61 | struct sigaltstack { |
| 62 | 	void *ss_sp; |
| 63 | 	int ss_flags; |
| 64 | 	size_t ss_size; |
| 65 | }; |
| 66 | |
| 67 | typedef struct __ucontext { |
| 68 | 	unsigned long uc_flags; |
| 69 | 	struct __ucontext *uc_link; |
| 70 | 	stack_t uc_stack; |
| 71 | 	mcontext_t uc_mcontext; |
| 72 | 	sigset_t uc_sigmask; |
| 73 | } ucontext_t; |
| 74 | |
| 75 | #define SA_NOCLDSTOP 1U |
| 76 | #define SA_NOCLDWAIT 2U |
| 77 | #define SA_SIGINFO 4U |
| 78 | #define SA_ONSTACK 0x08000000U |
| 79 | #define SA_RESTART 0x10000000U |
| 80 | #define SA_NODEFER 0x40000000U |
| 81 | #define SA_RESETHAND 0x80000000U |
| 82 | #define SA_RESTORER 0x04000000U |
| 83 | |
| 84 | #endif |
| 85 | |
| 86 | #define SIGHUP 1 |
| 87 | #define SIGINT 2 |
| 88 | #define SIGQUIT 3 |
| 89 | #define SIGILL 4 |
| 90 | #define SIGTRAP 5 |
| 91 | #define SIGABRT 6 |
| 92 | #define SIGIOT SIGABRT |
| 93 | #define SIGBUS 7 |
| 94 | #define SIGFPE 8 |
| 95 | #define SIGKILL 9 |
| 96 | #define SIGUSR1 10 |
| 97 | #define SIGSEGV 11 |
| 98 | #define SIGUSR2 12 |
| 99 | #define SIGPIPE 13 |
| 100 | #define SIGALRM 14 |
| 101 | #define SIGTERM 15 |
| 102 | #define SIGSTKFLT 16 |
| 103 | #define SIGCHLD 17 |
| 104 | #define SIGCONT 18 |
| 105 | #define SIGSTOP 19 |
| 106 | #define SIGTSTP 20 |
| 107 | #define SIGTTIN 21 |
| 108 | #define SIGTTOU 22 |
| 109 | #define SIGURG 23 |
| 110 | #define SIGXCPU 24 |
| 111 | #define SIGXFSZ 25 |
| 112 | #define SIGVTALRM 26 |
| 113 | #define SIGPROF 27 |
| 114 | #define SIGWINCH 28 |
| 115 | #define SIGIO 29 |
| 116 | #define SIGPOLL SIGIO |
| 117 | #define SIGPWR 30 |
| 118 | #define SIGSYS 31 |
| 119 | #define SIGUNUSED SIGSYS |
| 120 | |
| 121 | #define _NSIG 65 |