Signals
int pthread_sigmask(int how, const sigset_t * set, sigset_t * oset);
int sigaction(int sig, const struct sigaction * act, struct sigaction * oact);
int kill(int signal);
int pthread_kill(pthread_t, int signal);
int raise(int signal) { return(pthread_kill(pthread_self(), signal)); }
int sigwait(const sigset_t * set, int *sig);
int sigsuspend(const sigset_t *sigmask) { sigset_t set, oset; int sig, ret; sigemptyset(&set); if (ret = sigwait(sigmask, sig)) { sigaddset(&set, sig); pthread_kill(pthread_self(), sig)); pthread_sigmask(SIG_UNBLOCK, set, oset); pthread_sigmask(SIG_SIGSETMASK, &oset, NULL); } return(ret); }