SIGSETOPS(3) SIGSETOPS(3) NAME sigsetops: sigaddset, sigdelset, sigemptyset, sigfillset, sigismember, sgi_altersigs, sgi_sigffset, sgi_siganyset, sgi_dumpset - signal set manipulation and examination routines (POSIX, with SGI-specific additions) SYNOPSIS POSIX #include <signal.h> int sigaddset(sigset_t *set, int sig); int sigdelset(sigset_t *set, int sig); int sigemptyset(sigset_t *set); int sigfillset(sigset_t *set); int sigismember(sigset_t *set, int sig); SGI int sgi_altersigs(int action, sigset_t *set, int sigarray[]); int sgi_sigffset(sigset_t *set, int clearit); int sgi_siganyset(sigset_t *set); int sgi_dumpset(sigset_t *set); DESCRIPTION These library calls modify or return information about the disposition of the signal mask pointed to by set. The system defines a set of signals that may be delivered to a process. Signal delivery resembles the occurrence of a hardware interrupt: the signal is blocked from further occurrence, the current process context is saved, and a new one is built. A global signal mask defines the set of signals currently blocked from delivery to a process; it may be changed with a sigprocmask(2) call. The masks submitted as parameters to sigprocmask, sigaction, and sigsuspend and returned by sigpending may be constructed, altered, and examined via the sigsetops described in this man page. They do NOT themselves alter the global signal mask. The masks that the routines manipulate are of type sigset_t. sigaddset adds sig to the specified set. sigdelset deletes sig from the specified set. sigemptyset clears all signals in the specified set. sigfillset sets all signals in the specified set. sigismember returns 1 if sig is a member of the specified set, else returns 0. SGI-SPECIFIC FUNCTIONS The following four functions, although not part of the POSIX specification, provide additional capabilities: sgi_altersigs performs action on the specified signal set, for each signal in sigarray. Action may be ADDSIGS or DELSIGS (defined in <sys/signal.h). The final signal entry in sigarray must be followed by a 0 entry (in this way sgi_altersigs knows how many signals to process). The array may include all legal signals; however, if the intent is to set or clear all signals the sigaddset and sigdelset routines are more efficient. Any illegal signal numbers are silently skipped. sgi_altersigs returns the number of signals which were processed, or -1 with errno set to [EINVAL] if action is not ADDSIGS or DELSIGS. sgi_sigffset returns the number of the lowest pending signal in set. If none are pending, it returns 0. If clearit is non-zero, the returned signal is cleared in the mask. In this way sgi_sigffset may be used to sequentially examine the signals in a mask without duplication. sgi_siganyset(set) returns 1 if any signals are set in the specified mask, otherwise it returns 0. The mask is not altered. sgi_dumpset displays the specified set of signals as a bit-vector, primarily for debugging purposes. For a list of valid signal numbers please see signal(5). ERRORS In every routine, the set parameter is a pointer to sigset_t. All of these functions are library routines (executing in user space); therefore if they are passed a REFERENCE to set instead of a POINTER, the compiler will issue a warning, and when the program is run the process will receive a memory fault signal [SIGSEGV] and terminate (unless the process has installed a handler for SIGSEGV). All routines which require a sig parameter will fail, returning -1 and setting errno to [EINVAL] if sig is not a valid signal number. SEE ALSO sigaction(2), sigprocmask(2), sigpending(2), sigsuspend(2), sigsetjmp(3), pthread_sigmask(3P). WARNING The POSIX and System V signal facilities have different semantics. Using both facilities in the same program is strongly discouraged and will result in unpredictable behavior. Page 2