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