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 int greg_t, gregset_t[16]; 11 typedef int freg_t, fpregset_t[16]; 12 typedef struct sigcontext { 13 unsigned long oldmask; 14 unsigned long sc_regs[16]; 15 unsigned long sc_pc, sc_pr, sc_sr; 16 unsigned long sc_gbr, sc_mach, sc_macl; 17 unsigned long sc_fpregs[16]; 18 unsigned long sc_xfpregs[16]; 19 unsigned int sc_fpscr, sc_fpul, sc_ownedfp; 20 } mcontext_t; 21 #else 22 typedef struct { 23 unsigned long __regs[58]; 24 } mcontext_t; 25 #endif 26 27 struct sigaltstack { 28 void *ss_sp; 29 int ss_flags; 30 size_t ss_size; 31 }; 32 33 typedef struct __ucontext { 34 unsigned long uc_flags; 35 struct __ucontext *uc_link; 36 stack_t uc_stack; 37 mcontext_t uc_mcontext; 38 sigset_t uc_sigmask; 39 } ucontext_t; 40 41 #define SA_NOCLDSTOP 1 42 #define SA_NOCLDWAIT 2 43 #define SA_SIGINFO 4 44 #define SA_ONSTACK 0x08000000 45 #define SA_RESTART 0x10000000 46 #define SA_NODEFER 0x40000000 47 #define SA_RESETHAND 0x80000000 48 #define SA_RESTORER 0x04000000 49 50 #endif 51 52 #define SIGHUP 1 53 #define SIGINT 2 54 #define SIGQUIT 3 55 #define SIGILL 4 56 #define SIGTRAP 5 57 #define SIGABRT 6 58 #define SIGIOT SIGABRT 59 #define SIGBUS 7 60 #define SIGFPE 8 61 #define SIGKILL 9 62 #define SIGUSR1 10 63 #define SIGSEGV 11 64 #define SIGUSR2 12 65 #define SIGPIPE 13 66 #define SIGALRM 14 67 #define SIGTERM 15 68 #define SIGSTKFLT 16 69 #define SIGCHLD 17 70 #define SIGCONT 18 71 #define SIGSTOP 19 72 #define SIGTSTP 20 73 #define SIGTTIN 21 74 #define SIGTTOU 22 75 #define SIGURG 23 76 #define SIGXCPU 24 77 #define SIGXFSZ 25 78 #define SIGVTALRM 26 79 #define SIGPROF 27 80 #define SIGWINCH 28 81 #define SIGIO 29 82 #define SIGPOLL 29 83 #define SIGPWR 30 84 #define SIGSYS 31 85 #define SIGUNUSED SIGSYS 86 87 #define _NSIG 65 88