1570af302Sopenharmony_ci#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 2570af302Sopenharmony_ci || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 3570af302Sopenharmony_ci 4570af302Sopenharmony_ci#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 5570af302Sopenharmony_ci#define MINSIGSTKSZ 4096 6570af302Sopenharmony_ci#define SIGSTKSZ 10240 7570af302Sopenharmony_ci#endif 8570af302Sopenharmony_ci 9570af302Sopenharmony_ci#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 10570af302Sopenharmony_ci 11570af302Sopenharmony_citypedef unsigned long greg_t, gregset_t[27]; 12570af302Sopenharmony_ci 13570af302Sopenharmony_citypedef struct { 14570af302Sopenharmony_ci unsigned long mask; 15570af302Sopenharmony_ci unsigned long addr; 16570af302Sopenharmony_ci} __psw_t; 17570af302Sopenharmony_ci 18570af302Sopenharmony_citypedef union { 19570af302Sopenharmony_ci double d; 20570af302Sopenharmony_ci float f; 21570af302Sopenharmony_ci} fpreg_t; 22570af302Sopenharmony_ci 23570af302Sopenharmony_citypedef struct { 24570af302Sopenharmony_ci unsigned fpc; 25570af302Sopenharmony_ci fpreg_t fprs[16]; 26570af302Sopenharmony_ci} fpregset_t; 27570af302Sopenharmony_ci 28570af302Sopenharmony_citypedef struct 29570af302Sopenharmony_ci{ 30570af302Sopenharmony_ci __psw_t psw; 31570af302Sopenharmony_ci unsigned long gregs[16]; 32570af302Sopenharmony_ci unsigned aregs[16]; 33570af302Sopenharmony_ci fpregset_t fpregs; 34570af302Sopenharmony_ci} mcontext_t; 35570af302Sopenharmony_ci 36570af302Sopenharmony_cistruct sigcontext { 37570af302Sopenharmony_ci unsigned long oldmask[1]; 38570af302Sopenharmony_ci struct { 39570af302Sopenharmony_ci struct { 40570af302Sopenharmony_ci __psw_t psw; 41570af302Sopenharmony_ci unsigned long gprs[16]; 42570af302Sopenharmony_ci unsigned acrs[16]; 43570af302Sopenharmony_ci } regs; 44570af302Sopenharmony_ci struct { 45570af302Sopenharmony_ci unsigned fpc; 46570af302Sopenharmony_ci double fprs[16]; 47570af302Sopenharmony_ci } fpregs; 48570af302Sopenharmony_ci } *sregs; 49570af302Sopenharmony_ci}; 50570af302Sopenharmony_ci 51570af302Sopenharmony_ci#else 52570af302Sopenharmony_ci 53570af302Sopenharmony_citypedef struct { 54570af302Sopenharmony_ci unsigned long __regs1[18]; 55570af302Sopenharmony_ci unsigned __regs2[18]; 56570af302Sopenharmony_ci double __regs3[16]; 57570af302Sopenharmony_ci} mcontext_t; 58570af302Sopenharmony_ci 59570af302Sopenharmony_ci#endif 60570af302Sopenharmony_ci 61570af302Sopenharmony_cistruct sigaltstack { 62570af302Sopenharmony_ci void *ss_sp; 63570af302Sopenharmony_ci int ss_flags; 64570af302Sopenharmony_ci size_t ss_size; 65570af302Sopenharmony_ci}; 66570af302Sopenharmony_ci 67570af302Sopenharmony_citypedef struct __ucontext { 68570af302Sopenharmony_ci unsigned long uc_flags; 69570af302Sopenharmony_ci struct __ucontext *uc_link; 70570af302Sopenharmony_ci stack_t uc_stack; 71570af302Sopenharmony_ci mcontext_t uc_mcontext; 72570af302Sopenharmony_ci sigset_t uc_sigmask; 73570af302Sopenharmony_ci} ucontext_t; 74570af302Sopenharmony_ci 75570af302Sopenharmony_ci#define SA_NOCLDSTOP 1U 76570af302Sopenharmony_ci#define SA_NOCLDWAIT 2U 77570af302Sopenharmony_ci#define SA_SIGINFO 4U 78570af302Sopenharmony_ci#define SA_ONSTACK 0x08000000U 79570af302Sopenharmony_ci#define SA_RESTART 0x10000000U 80570af302Sopenharmony_ci#define SA_NODEFER 0x40000000U 81570af302Sopenharmony_ci#define SA_RESETHAND 0x80000000U 82570af302Sopenharmony_ci#define SA_RESTORER 0x04000000U 83570af302Sopenharmony_ci 84570af302Sopenharmony_ci#endif 85570af302Sopenharmony_ci 86570af302Sopenharmony_ci#define SIGHUP 1 87570af302Sopenharmony_ci#define SIGINT 2 88570af302Sopenharmony_ci#define SIGQUIT 3 89570af302Sopenharmony_ci#define SIGILL 4 90570af302Sopenharmony_ci#define SIGTRAP 5 91570af302Sopenharmony_ci#define SIGABRT 6 92570af302Sopenharmony_ci#define SIGIOT SIGABRT 93570af302Sopenharmony_ci#define SIGBUS 7 94570af302Sopenharmony_ci#define SIGFPE 8 95570af302Sopenharmony_ci#define SIGKILL 9 96570af302Sopenharmony_ci#define SIGUSR1 10 97570af302Sopenharmony_ci#define SIGSEGV 11 98570af302Sopenharmony_ci#define SIGUSR2 12 99570af302Sopenharmony_ci#define SIGPIPE 13 100570af302Sopenharmony_ci#define SIGALRM 14 101570af302Sopenharmony_ci#define SIGTERM 15 102570af302Sopenharmony_ci#define SIGSTKFLT 16 103570af302Sopenharmony_ci#define SIGCHLD 17 104570af302Sopenharmony_ci#define SIGCONT 18 105570af302Sopenharmony_ci#define SIGSTOP 19 106570af302Sopenharmony_ci#define SIGTSTP 20 107570af302Sopenharmony_ci#define SIGTTIN 21 108570af302Sopenharmony_ci#define SIGTTOU 22 109570af302Sopenharmony_ci#define SIGURG 23 110570af302Sopenharmony_ci#define SIGXCPU 24 111570af302Sopenharmony_ci#define SIGXFSZ 25 112570af302Sopenharmony_ci#define SIGVTALRM 26 113570af302Sopenharmony_ci#define SIGPROF 27 114570af302Sopenharmony_ci#define SIGWINCH 28 115570af302Sopenharmony_ci#define SIGIO 29 116570af302Sopenharmony_ci#define SIGPOLL SIGIO 117570af302Sopenharmony_ci#define SIGPWR 30 118570af302Sopenharmony_ci#define SIGSYS 31 119570af302Sopenharmony_ci#define SIGUNUSED SIGSYS 120570af302Sopenharmony_ci 121570af302Sopenharmony_ci#define _NSIG 65 122