| 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 2048 |
| 6 | #define SIGSTKSZ 8192 |
| 7 | #endif |
| 8 | |
| 9 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 10 | typedef unsigned long long greg_t, gregset_t[32]; |
| 11 | typedef struct { |
| 12 | 	union { |
| 13 | 		double fp_dregs[32]; |
| 14 | 		struct { |
| 15 | 			float _fp_fregs; |
| 16 | 			unsigned _fp_pad; |
| 17 | 		} fp_fregs[32]; |
| 18 | 	} fp_r; |
| 19 | } fpregset_t; |
| 20 | struct sigcontext { |
| 21 | 	unsigned sc_regmask, sc_status; |
| 22 | 	unsigned long long sc_pc; |
| 23 | 	gregset_t sc_regs; |
| 24 | 	fpregset_t sc_fpregs; |
| 25 | 	unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp; |
| 26 | 	unsigned long long sc_mdhi, sc_mdlo; |
| 27 | 	unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3; |
| 28 | }; |
| 29 | typedef struct { |
| 30 | 	unsigned regmask, status; |
| 31 | 	unsigned long long pc; |
| 32 | 	gregset_t gregs; |
| 33 | 	fpregset_t fpregs; |
| 34 | 	unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp; |
| 35 | 	unsigned long long mdhi, mdlo; |
| 36 | 	unsigned long hi1, lo1, hi2, lo2, hi3, lo3; |
| 37 | } mcontext_t; |
| 38 | #else |
| 39 | typedef struct { |
| 40 | 	unsigned __mc1[2]; |
| 41 | 	unsigned long long __mc2[65]; |
| 42 | 	unsigned __mc3[5]; |
| 43 | 	unsigned long long __mc4[2]; |
| 44 | 	unsigned __mc5[6]; |
| 45 | } mcontext_t; |
| 46 | #endif |
| 47 | |
| 48 | struct sigaltstack { |
| 49 | 	void *ss_sp; |
| 50 | 	size_t ss_size; |
| 51 | 	int ss_flags; |
| 52 | }; |
| 53 | |
| 54 | typedef struct __ucontext { |
| 55 | 	unsigned long uc_flags; |
| 56 | 	struct __ucontext *uc_link; |
| 57 | 	stack_t uc_stack; |
| 58 | 	mcontext_t uc_mcontext; |
| 59 | 	sigset_t uc_sigmask; |
| 60 | } ucontext_t; |
| 61 | |
| 62 | #define SA_NOCLDSTOP 1 |
| 63 | #define SA_NOCLDWAIT 0x10000 |
| 64 | #define SA_SIGINFO 8 |
| 65 | #define SA_ONSTACK 0x08000000 |
| 66 | #define SA_RESTART 0x10000000 |
| 67 | #define SA_NODEFER 0x40000000 |
| 68 | #define SA_RESETHAND 0x80000000 |
| 69 | |
| 70 | #undef SIG_BLOCK |
| 71 | #undef SIG_UNBLOCK |
| 72 | #undef SIG_SETMASK |
| 73 | #define SIG_BLOCK 1 |
| 74 | #define SIG_UNBLOCK 2 |
| 75 | #define SIG_SETMASK 3 |
| 76 | |
| 77 | #undef SI_ASYNCIO |
| 78 | #undef SI_MESGQ |
| 79 | #undef SI_TIMER |
| 80 | #define SI_ASYNCIO (-2) |
| 81 | #define SI_MESGQ (-4) |
| 82 | #define SI_TIMER (-3) |
| 83 | |
| 84 | #define __SI_SWAP_ERRNO_CODE |
| 85 | |
| 86 | #endif |
| 87 | |
| 88 | #define SIGHUP 1 |
| 89 | #define SIGINT 2 |
| 90 | #define SIGQUIT 3 |
| 91 | #define SIGILL 4 |
| 92 | #define SIGTRAP 5 |
| 93 | #define SIGABRT 6 |
| 94 | #define SIGIOT SIGABRT |
| 95 | #define SIGEMT 7 |
| 96 | #define SIGFPE 8 |
| 97 | #define SIGKILL 9 |
| 98 | #define SIGBUS 10 |
| 99 | #define SIGSEGV 11 |
| 100 | #define SIGSYS 12 |
| 101 | #define SIGPIPE 13 |
| 102 | #define SIGALRM 14 |
| 103 | #define SIGTERM 15 |
| 104 | #define SIGUSR1 16 |
| 105 | #define SIGUSR2 17 |
| 106 | #define SIGCHLD 18 |
| 107 | #define SIGPWR 19 |
| 108 | #define SIGWINCH 20 |
| 109 | #define SIGURG 21 |
| 110 | #define SIGIO 22 |
| 111 | #define SIGPOLL SIGIO |
| 112 | #define SIGSTOP 23 |
| 113 | #define SIGTSTP 24 |
| 114 | #define SIGCONT 25 |
| 115 | #define SIGTTIN 26 |
| 116 | #define SIGTTOU 27 |
| 117 | #define SIGVTALRM 28 |
| 118 | #define SIGPROF 29 |
| 119 | #define SIGXCPU 30 |
| 120 | #define SIGXFSZ 31 |
| 121 | #define SIGUNUSED SIGSYS |
| 122 | |
| 123 | #define _NSIG 128 |