NAME |LIBRARY |SYNOPSIS |DESCRIPTION |RETURN VALUE |ERRORS |ATTRIBUTES |STANDARDS |HISTORY |NOTES |SEE ALSO |COLOPHON | |
sigvec(3) Library Functions Manualsigvec(3)sigvec, sigblock, sigsetmask, siggetmask, sigmask - BSD signal API
Standard C library (libc,-lc)
#include <signal.h>[[deprecated]] int sigvec(intsig, const struct sigvec *vec,struct sigvec *ovec);[[deprecated]] int sigmask(intsignum);[[deprecated]] int sigblock(intmask);[[deprecated]] int sigsetmask(intmask);[[deprecated]] int siggetmask(void); Feature Test Macro Requirements for glibc (seefeature_test_macros(7)): All functions shown above: Since glibc 2.19: _DEFAULT_SOURCE glibc 2.19 and earlier: _BSD_SOURCE
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.). Thesigvec() function sets and/or gets the disposition of the signalsig (like the POSIXsigaction(2)). Ifvec is not NULL, it points to asigvec structure that defines the new disposition forsig. Ifovec is not NULL, it points to asigvec structure that is used to return the previous disposition ofsig. To obtain the current disposition ofsig without changing it, specify NULL forvec, and a non-null pointer forovec. The dispositions forSIGKILLandSIGSTOPcannot be changed. Thesigvec structure has the following form: struct sigvec { void (*sv_handler)(int); /* Signal disposition */ int sv_mask; /* Signals to be blocked in handler */ int sv_flags; /* Flags */ }; Thesv_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; orSIG_IGN, meaning that the signal is ignored. Ifsv_handler specifies the address of a signal handler, thensv_mask specifies a mask of signals that are to be blocked while the handler is executing. In addition, the signal for which the handler is invoked is also blocked. Attempts to blockSIGKILLorSIGSTOPare silently ignored. Ifsv_handler specifies the address of a signal handler, then thesv_flags field specifies flags controlling what happens when the handler is called. This field may contain zero or more of the following flags:SV_INTERRUPT If the signal handler interrupts a blocking system call, then upon return from the handler the system call is not restarted: instead it fails with the errorEINTR. 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 tosigvec() or until the process performs anexecve(2).SV_ONSTACK Handle the signal on the alternate signal stack (historically established under BSD using the obsoletesigstack() function; the POSIX replacement issigaltstack(2)). Thesigmask() macro constructs and returns a "signal mask" forsignum. For example, we can initialize thevec.sv_mask field given tosigvec() using code such as the following: vec.sv_mask = sigmask(SIGQUIT) | sigmask(SIGABRT); /* Block SIGQUIT and SIGABRT during handler execution */ Thesigblock() function adds the signals inmask to the process's signal mask (like POSIXsigprocmask(SIG_BLOCK)), and returns the process's previous signal mask. Attempts to blockSIGKILLorSIGSTOPare silently ignored. Thesigsetmask() function sets the process's signal mask to the value given inmask (like POSIXsigprocmask(SIG_SETMASK)), and returns the process's previous signal mask. Thesiggetmask() function returns the process's current signal mask. This call is equivalent tosigblock(0).Thesigvec() function returns 0 on success; on error, it returns -1 and setserrno to indicate the error. Thesigblock() andsigsetmask() functions return the previous signal mask. Thesigmask() macro returns the signal mask forsignum.
See the ERRORS undersigaction(2) andsigprocmask(2).
For an explanation of the terms used in this section, seeattributes(7). ┌──────────────────────────────────────┬───────────────┬─────────┐ │Interface│Attribute│Value│ ├──────────────────────────────────────┼───────────────┼─────────┤ │sigvec(),sigmask(),sigblock(), │ Thread safety │ MT-Safe │ │sigsetmask(),siggetmask() │ │ │ └──────────────────────────────────────┴───────────────┴─────────┘
None.
sigvec()sigblock()sigmask()sigsetmask() 4.3BSD.siggetmask() Unclear origin.sigvec() Removed in glibc 2.21.
On 4.3BSD, thesignal() function provided reliable semantics (as when callingsigvec() withvec.sv_mask equal to 0). On System V,signal() provides unreliable semantics. POSIX.1 leaves these aspects ofsignal() unspecified. Seesignal(2) for further details. In order to wait for a signal, BSD and System V both provided a function namedsigpause(3), but this function has a different argument on the two systems. Seesigpause(3) for details.
kill(2),pause(2),sigaction(2),signal(2),sigprocmask(2),raise(3),sigpause(3),sigset(3),signal(7)
This page is part of theman-pages (Linux kernel and C library user-space interface documentation) project. Information about the project can be found at ⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report for this manual page, see ⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩. This page was obtained from the tarball man-pages-6.15.tar.gz fetched from ⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on 2025-08-11. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up- to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orgLinux man-pages 6.15 2025-05-17sigvec(3)Pages that refer to this page:sgetmask(2), sigaction(2), signal(2), sigpause(3), sigset(3), signal(7)
HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |