Manual Pages for Linux CentOS command on man sigblock
MyWebUniversity

Manual Pages for Linux CentOS command on man sigblock

SIGVEC(3) Linux Programmer's Manual SIGVEC(3)

NAME

sigvec, sigblock, sigsetmask, siggetmask, sigmask - BSD signal API SYNOPSIS

#include int sigvec(int sig, struct sigvec *vec, struct sigvec *ovec); int sigmask(int signum); int sigblock(int mask); int sigsetmask(int mask); int siggetmask(void); Feature Test Macro Requirements for glibc (see featuretestmacros(7)): All functions shown above: BSDSOURCE 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 (sigac‐ tion(2), sigprocmask(2), etc.). The sigvec() function sets and/or gets the disposition of the signal sig (like the POSIX sigaction(2)). If vec is not NULL, it points to a sigvec structure that defines the new disposition for sig. If ovec is not NULL, it points to a sigvec structure that is used to return the previous disposition of sig. To obtain the current disposition of sig

without changing it, specify NULL for vec, and a non-NULL pointer for ovec. The dispositions for SIGKILL and SIGSTOP cannot be changed. The sigvec structure has the following form: struct sigvec { void (*svhandler)(int); /* Signal disposition */ int svmask; /* Signals to be blocked in handler */ int svflags; /* Flags */ }; The svhandler field specifies the disposition of the signal, and is either: the address of a signal handler function; SIGDFL, meaning the default disposition applies for the signal; or SIGIGN, meaning that the signal is ignored. If svhandler specifies the address of a signal handler, then svmask 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 block SIGKILL or SIGSTOP are silently ignored. If svhandler specifies the address of a signal handler, then the svflags field specifies flags controlling what happens when the han‐ dler is called. This field may contain zero or more of the following flags: SVINTERRUPT 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. SVRESETHAND Reset the disposition of the signal to the default before call‐ ing 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). SVONSTACK Handle the signal on the alternate signal stack (historically established under BSD using the obsolete sigstack() function; the POSIX replacement is sigaltstack(2)). The sigmask() function constructs and returns a "signal mask" for signum. For example, we can initialize the vec.svmask field given to sigvec() using code such as the following: vec.svmask = sigmask(SIGQUIT) | sigpause(SIGABRT); /* Block SIGQUIT and SIGABRT during handler execution */ The sigblock() function adds the signals in mask to the process's sig‐ nal mask (like POSIX sigprocmask(SIGBLOCK)), 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(SIGSETMASK)), 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. The sigblock() and sigsetmask() functions return the previous signal mask. The sigmask() function returns the signal mask for signum. ERRORS See the ERRORS under sigaction(2) and sigprocmask(2). ATTRIBUTES For an explanation of the terms used in this section, see attributes(7). ┌─────────────────────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├─────────────────────────────────┼───────────────┼─────────┤

│sigvec(), sigmask(), sigblock(), │ Thread safety │ MT-Safe │ │sigsetmask(), siggetmask() │ │ │ └─────────────────────────────────┴───────────────┴─────────┘ VERSIONS Starting with version 2.21, the GNU C library no longer exports the sigvec() function as part of the ABI. (To ensure backward compatibil‐ ity, the glibc symbol versioning scheme continues to export the inter‐ face to binaries linked against older versions of the library.) CONFORMING TO All of these functions were in 4.3BSD, except siggetmask(), whose ori‐ gin 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.svmask 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. In order to wait for a signal, BSD and System V both provided a func‐ tion named sigpause(3), but this function has a different argument on the two systems. See sigpause(3) for 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.53 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/.

Linux 2012-09-06 SIGVEC(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™