table of contents
other versions
- wheezy 3.44-1
- jessie 3.74-1
- jessie-backports 4.10-2~bpo8+1
- testing 4.10-2
- unstable 4.10-2
other sections
SIGVEC(3) | Linux Programmer's Manual | SIGVEC(3) |
NAME¶
sigvec, sigblock, sigsetmask, siggetmask, sigmask - BSD signal APISYNOPSIS¶
#include <signal.h>Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
DESCRIPTION¶
These functions are provided in glibc as a compatibility interface for programs that make use of the historical BSD signal API. This API is obsolete: new applications should use the POSIX signal API (sigaction(2), sigprocmask(2), etc.).struct sigvec { void (*sv_handler)(int); /* Signal disposition */ int sv_mask; /* Signals to be blocked in handler */ int sv_flags; /* Flags */ };
The sv_handler field specifies the disposition of the signal, and is either: the address of a signal handler function; SIG_DFL, meaning the default disposition applies for the signal; or SIG_IGN, meaning that the signal is ignored.
- SV_INTERRUPT
- If the signal handler interrupts a blocking system call, then upon return from the handler the system call will not be restarted: instead it will fail with the error EINTR. If this flag is not specified, then system calls are restarted by default.
- SV_RESETHAND
- Reset the disposition of the signal to the default before calling the signal handler. If this flag is not specified, then the handler remains established until explicitly removed by a later call to sigvec() or until the process performs an execve(2).
- SV_ONSTACK
- Handle the signal on the alternate signal stack (historically established under BSD using the obsolete sigstack() function; the POSIX replacement is sigaltstack(2)).
vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT); /* Block SIGQUIT and SIGABRT during handler execution */The sigblock() function adds the signals in mask to the process's signal mask (like POSIX sigprocmask(SIG_BLOCK)), and returns the process's previous signal mask. Attempts to block SIGKILL or SIGSTOP are silently ignored. The sigsetmask() function sets the process's signal mask to the value given in mask (like POSIX sigprocmask(SIG_SETMASK)), and returns the process's previous signal mask. The siggetmask() function returns the process's current signal mask. This call is equivalent to sigblock(0).
RETURN VALUE¶
The sigvec() function returns 0 on success; on error, it returns -1 and sets errno to indicate the error.ERRORS¶
See the ERRORS under sigaction(2) and sigprocmask(2).CONFORMING TO¶
All of these functions were in 4.3BSD, except siggetmask(), whose origin is unclear. These functions are obsolete: do not use them in new programs.NOTES¶
On 4.3BSD, the signal() function provided reliable semantics (as when calling sigvec() with vec.sv_mask equal to 0). On System V, signal() provides unreliable semantics. POSIX.1-2001 leaves these aspects of signal() unspecified. See signal(2) for further details.SEE ALSO¶
kill(2), pause(2), sigaction(2), signal(2), sigprocmask(2), raise(3), sigpause(3), sigset(3), signal(7)COLOPHON¶
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.2012-09-06 | Linux |