1570af302Sopenharmony_ci#include <signal.h> 2570af302Sopenharmony_ci#define T(t) (t*)0; 3570af302Sopenharmony_ci#define F(t,n) {t *y = &x.n;} 4570af302Sopenharmony_ci#define C(n) switch(n){case n:;} 5570af302Sopenharmony_cistatic void f() 6570af302Sopenharmony_ci{ 7570af302Sopenharmony_ciT(sig_atomic_t) 8570af302Sopenharmony_ci{void(*x)(int) = SIG_DFL;} 9570af302Sopenharmony_ci{void(*x)(int) = SIG_ERR;} 10570af302Sopenharmony_ci{void(*x)(int) = SIG_IGN;} 11570af302Sopenharmony_ci#ifdef _POSIX_C_SOURCE 12570af302Sopenharmony_ci{void(*x)(int) = SIG_HOLD;} 13570af302Sopenharmony_ciT(size_t) 14570af302Sopenharmony_ciT(sigset_t) 15570af302Sopenharmony_ciT(pid_t) 16570af302Sopenharmony_ciT(uid_t) 17570af302Sopenharmony_ciT(pthread_t) 18570af302Sopenharmony_ciT(pthread_attr_t) 19570af302Sopenharmony_ciT(struct timespec) 20570af302Sopenharmony_ci{ 21570af302Sopenharmony_cistruct sigevent x; 22570af302Sopenharmony_ciF(int,sigev_notify) 23570af302Sopenharmony_ciF(int,sigev_signo) 24570af302Sopenharmony_ciF(union sigval,sigev_value) 25570af302Sopenharmony_ci{void (**y)(union sigval) = &x.sigev_notify_function;} 26570af302Sopenharmony_ciF(pthread_attr_t*,sigev_notify_attributes) 27570af302Sopenharmony_ci} 28570af302Sopenharmony_ciC(SIGEV_NONE) 29570af302Sopenharmony_ciC(SIGEV_SIGNAL) 30570af302Sopenharmony_ciC(SIGEV_THREAD) 31570af302Sopenharmony_ci{ 32570af302Sopenharmony_ciunion sigval x; 33570af302Sopenharmony_ciF(int,sival_int) 34570af302Sopenharmony_ciF(void*,sival_ptr) 35570af302Sopenharmony_ci} 36570af302Sopenharmony_ci{int i = SIGRTMIN;} 37570af302Sopenharmony_ci{int i = SIGRTMAX;} 38570af302Sopenharmony_ci#endif 39570af302Sopenharmony_ciC(SIGABRT) 40570af302Sopenharmony_ciC(SIGFPE) 41570af302Sopenharmony_ciC(SIGILL) 42570af302Sopenharmony_ciC(SIGINT) 43570af302Sopenharmony_ciC(SIGSEGV) 44570af302Sopenharmony_ciC(SIGTERM) 45570af302Sopenharmony_ci#ifdef _POSIX_C_SOURCE 46570af302Sopenharmony_ciC(SIGALRM) 47570af302Sopenharmony_ciC(SIGBUS) 48570af302Sopenharmony_ciC(SIGCHLD) 49570af302Sopenharmony_ciC(SIGCONT) 50570af302Sopenharmony_ciC(SIGHUP) 51570af302Sopenharmony_ciC(SIGKILL) 52570af302Sopenharmony_ciC(SIGPIPE) 53570af302Sopenharmony_ciC(SIGQUIT) 54570af302Sopenharmony_ciC(SIGSTOP) 55570af302Sopenharmony_ciC(SIGTSTP) 56570af302Sopenharmony_ciC(SIGTTIN) 57570af302Sopenharmony_ciC(SIGTTOU) 58570af302Sopenharmony_ciC(SIGUSR1) 59570af302Sopenharmony_ciC(SIGUSR2) 60570af302Sopenharmony_ciC(SIGURG) 61570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE 62570af302Sopenharmony_ciC(SIGSYS) 63570af302Sopenharmony_ciC(SIGTRAP) 64570af302Sopenharmony_ciC(SIGVTALRM) 65570af302Sopenharmony_ciC(SIGXCPU) 66570af302Sopenharmony_ciC(SIGXFSZ) 67570af302Sopenharmony_ci#endif 68570af302Sopenharmony_ci{ 69570af302Sopenharmony_cistruct sigaction x; 70570af302Sopenharmony_ci{void (**y)(int) = &x.sa_handler;} 71570af302Sopenharmony_ciF(sigset_t, sa_mask) 72570af302Sopenharmony_ciF(int,sa_flags) 73570af302Sopenharmony_ci{void (**y)(int, siginfo_t *, void *) = &x.sa_sigaction;} 74570af302Sopenharmony_ci} 75570af302Sopenharmony_ciC(SIG_BLOCK) 76570af302Sopenharmony_ciC(SIG_UNBLOCK) 77570af302Sopenharmony_ciC(SIG_SETMASK) 78570af302Sopenharmony_ciC(SA_NOCLDSTOP) 79570af302Sopenharmony_ciC(SA_RESETHAND) 80570af302Sopenharmony_ciC(SA_RESTART) 81570af302Sopenharmony_ciC(SA_SIGINFO) 82570af302Sopenharmony_ciC(SA_NOCLDWAIT) 83570af302Sopenharmony_ciC(SA_NODEFER) 84570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE 85570af302Sopenharmony_ciC(SA_ONSTACK) 86570af302Sopenharmony_ciC(SS_ONSTACK) 87570af302Sopenharmony_ciC(SS_DISABLE) 88570af302Sopenharmony_ciC(MINSIGSTKSZ) 89570af302Sopenharmony_ciC(SIGSTKSZ) 90570af302Sopenharmony_ci#endif 91570af302Sopenharmony_ciT(mcontext_t) 92570af302Sopenharmony_ci{ 93570af302Sopenharmony_ciucontext_t x; 94570af302Sopenharmony_ciF(ucontext_t*,uc_link) 95570af302Sopenharmony_ciF(sigset_t,uc_sigmask) 96570af302Sopenharmony_ciF(stack_t, uc_stack) 97570af302Sopenharmony_ciF(mcontext_t,uc_mcontext) 98570af302Sopenharmony_ci} 99570af302Sopenharmony_ci{ 100570af302Sopenharmony_cistack_t x; 101570af302Sopenharmony_ciF(void *,ss_sp) 102570af302Sopenharmony_ciF(size_t,ss_size) 103570af302Sopenharmony_ciF(int, ss_flags) 104570af302Sopenharmony_ci} 105570af302Sopenharmony_ci{ 106570af302Sopenharmony_cisiginfo_t x; 107570af302Sopenharmony_ciF(int, si_signo) 108570af302Sopenharmony_ciF(int, si_code) 109570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE 110570af302Sopenharmony_ciF(int, si_errno) 111570af302Sopenharmony_ci#endif 112570af302Sopenharmony_ciF(pid_t, si_pid) 113570af302Sopenharmony_ciF(uid_t, si_uid) 114570af302Sopenharmony_ciF(void *,si_addr) 115570af302Sopenharmony_ciF(int, si_status) 116570af302Sopenharmony_ciF(union sigval,si_value) 117570af302Sopenharmony_ci} 118570af302Sopenharmony_ciC(ILL_ILLOPC) 119570af302Sopenharmony_ciC(ILL_ILLOPN) 120570af302Sopenharmony_ciC(ILL_ILLADR) 121570af302Sopenharmony_ciC(ILL_ILLTRP) 122570af302Sopenharmony_ciC(ILL_PRVOPC) 123570af302Sopenharmony_ciC(ILL_PRVREG) 124570af302Sopenharmony_ciC(ILL_COPROC) 125570af302Sopenharmony_ciC(ILL_BADSTK) 126570af302Sopenharmony_ciC(FPE_INTDIV) 127570af302Sopenharmony_ciC(FPE_INTOVF) 128570af302Sopenharmony_ciC(FPE_FLTDIV) 129570af302Sopenharmony_ciC(FPE_FLTOVF) 130570af302Sopenharmony_ciC(FPE_FLTUND) 131570af302Sopenharmony_ciC(FPE_FLTRES) 132570af302Sopenharmony_ciC(FPE_FLTINV) 133570af302Sopenharmony_ciC(FPE_FLTSUB) 134570af302Sopenharmony_ciC(SEGV_MAPERR) 135570af302Sopenharmony_ciC(SEGV_ACCERR) 136570af302Sopenharmony_ciC(BUS_ADRALN) 137570af302Sopenharmony_ciC(BUS_ADRERR) 138570af302Sopenharmony_ciC(BUS_OBJERR) 139570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE 140570af302Sopenharmony_ciC(TRAP_BRKPT) 141570af302Sopenharmony_ciC(TRAP_TRACE) 142570af302Sopenharmony_ci#endif 143570af302Sopenharmony_ciC(CLD_EXITED) 144570af302Sopenharmony_ciC(CLD_KILLED) 145570af302Sopenharmony_ciC(CLD_DUMPED) 146570af302Sopenharmony_ciC(CLD_TRAPPED) 147570af302Sopenharmony_ciC(CLD_STOPPED) 148570af302Sopenharmony_ciC(CLD_CONTINUED) 149570af302Sopenharmony_ciC(SI_USER) 150570af302Sopenharmony_ciC(SI_QUEUE) 151570af302Sopenharmony_ciC(SI_TIMER) 152570af302Sopenharmony_ciC(SI_ASYNCIO) 153570af302Sopenharmony_ciC(SI_MESGQ) 154570af302Sopenharmony_ci{int(*p)(pid_t,int) = kill;} 155570af302Sopenharmony_ci{int(*p)(pid_t,int) = killpg;} 156570af302Sopenharmony_ci{void(*p)(const siginfo_t*,const char*) = psiginfo;} 157570af302Sopenharmony_ci{void(*p)(int,const char*) = psignal;} 158570af302Sopenharmony_ci{int(*p)(pthread_t,int) = pthread_kill;} 159570af302Sopenharmony_ci{int(*p)(int,const sigset_t*restrict,sigset_t*restrict) = pthread_sigmask;} 160570af302Sopenharmony_ci{int(*p)(int,const struct sigaction*restrict,struct sigaction*restrict) = sigaction;} 161570af302Sopenharmony_ci{int(*p)(sigset_t*,int) = sigaddset;} 162570af302Sopenharmony_ci{int(*p)(const stack_t*restrict,stack_t*restrict) = sigaltstack;} 163570af302Sopenharmony_ci{int(*p)(sigset_t*,int) = sigdelset;} 164570af302Sopenharmony_ci{int(*p)(sigset_t*) = sigemptyset;} 165570af302Sopenharmony_ci{int(*p)(sigset_t*) = sigfillset;} 166570af302Sopenharmony_ci{int(*p)(int) = sighold;} 167570af302Sopenharmony_ci{int(*p)(int) = sigignore;} 168570af302Sopenharmony_ci{int(*p)(int,int) = siginterrupt;} 169570af302Sopenharmony_ci{int(*p)(const sigset_t*,int) = sigismember;} 170570af302Sopenharmony_ci{int(*p)(int) = sigpause;} 171570af302Sopenharmony_ci{int(*p)(sigset_t*) = sigpending;} 172570af302Sopenharmony_ci{int(*p)(int,const sigset_t*restrict,sigset_t*restrict) = sigprocmask;} 173570af302Sopenharmony_ci{int(*p)(pid_t,int,const union sigval) = sigqueue;} 174570af302Sopenharmony_ci{int(*p)(int) = sigrelse;} 175570af302Sopenharmony_ci{void(*(*p)(int,void(*)(int)))(int) = sigset;} 176570af302Sopenharmony_ci{int(*p)(const sigset_t*) = sigsuspend;} 177570af302Sopenharmony_ci{int(*p)(const sigset_t*restrict,siginfo_t*restrict,const struct timespec*restrict) = sigtimedwait;} 178570af302Sopenharmony_ci{int(*p)(const sigset_t*restrict,int*restrict) = sigwait;} 179570af302Sopenharmony_ci{int(*p)(const sigset_t*restrict,siginfo_t*restrict) = sigwaitinfo;} 180570af302Sopenharmony_ci#endif 181570af302Sopenharmony_ci{int(*p)(int) = raise;} 182570af302Sopenharmony_ci{void(*(*p)(int,void(*)(int)))(int) = signal;} 183570af302Sopenharmony_ci} 184