Signals


Signal Masks

int pthread_sigmask(int how, const sigset_t * set, sigset_t * oset);


Signal Vectors

int sigaction(int sig, const struct sigaction * act, struct sigaction * oact);


Generating Signals

int kill(int signal);

int pthread_kill(pthread_t, int signal);

int raise(int signal)
{
	return(pthread_kill(pthread_self(), signal));
}


Waiting for Signals

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);
}


[TOP] [BACK] [FORWARD]


Prepared by Chris Provenzano (proven@mit.edu)