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