1SIGSET(3)                  Linux Programmer's Manual                 SIGSET(3)
2
3
4

NAME

6       sigset, sighold, sigrelse, sigignore - System V signal API
7

SYNOPSIS

9       #include <signal.h>
10
11       typedef void (*sighandler_t)(int);
12
13       sighandler_t sigset(int sig, sighandler_t disp);
14
15       int sighold(int sig);
16
17       int sigrelse(int sig);
18
19       int sigignore(int sig);
20
21   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
22
23       sigset(), sighold(), sigrelse(), sigignore():
24           _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
25

DESCRIPTION

27       These  functions are provided in glibc as a compatibility interface for
28       programs that make use of the historical System V signal API.  This API
29       is  obsolete:  new applications should use the POSIX signal API (sigac‐
30       tion(2), sigprocmask(2), etc.)
31
32       The sigset() function modifies the disposition of the signal sig.   The
33       disp  argument  can be the address of a signal handler function, or one
34       of the following constants:
35
36       SIG_DFL
37              Reset the disposition of sig to the default.
38
39       SIG_IGN
40              Ignore sig.
41
42       SIG_HOLD
43              Add sig to the process's signal mask, but leave the  disposition
44              of sig unchanged.
45
46       If disp specifies the address of a signal handler, then sig is added to
47       the process's signal mask during execution of the handler.
48
49       If disp was specified as a value  other  than  SIG_HOLD,  then  sig  is
50       removed from the process's signal mask.
51
52       The dispositions for SIGKILL and SIGSTOP cannot be changed.
53
54       The sighold() function adds sig to the calling process's signal mask.
55
56       The  sigrelse()  function removes sig from the calling process's signal
57       mask.
58
59       The sigignore() function sets the disposition of sig to SIG_IGN.
60

RETURN VALUE

62       On success, sigset() returns SIG_HOLD if sig  was  blocked  before  the
63       call, or the signal's previous disposition if it was not blocked before
64       the call.  On error, sigset() returns -1, with errno  set  to  indicate
65       the error.  (But see BUGS below.)
66
67       The  sighold(),  sigrelse(), and sigignore() functions return 0 on suc‐
68       cess; on error, these functions return -1 and set errno to indicate the
69       error.
70

ERRORS

72       For sigset() see the ERRORS under sigaction(2) and sigprocmask(2).
73
74       For sighold() and sigrelse() see the ERRORS under sigprocmask(2).
75
76       For sigignore(), see the errors under sigaction(2).
77

CONFORMING TO

79       SVr4,  POSIX.1-2001.   These functions are obsolete: do not use them in
80       new programs.  POSIX.1-2008 marks sighold(),  sigignore(),  sigpause(),
81       sigrelse(),  and  sigset()  as obsolete, recommending the use of sigac‐
82       tion(2), sigprocmask(2), pthread_sigmask(3), and sigsuspend(2) instead.
83

NOTES

85       These functions appeared in glibc version 2.1.
86
87       The sighandler_t type is a GNU extension; it is used on this page  only
88       to make the sigset() prototype more easily readable.
89
90       The  sigset()  function provides reliable signal handling semantics (as
91       when calling sigaction(2) with sa_mask equal to 0).
92
93       On System V, the signal() function provides  unreliable  semantics  (as
94       when calling sigaction(2) with sa_mask equal to SA_RESETHAND | SA_NODE‐
95       FER).  On BSD,  signal()  provides  reliable  semantics.   POSIX.1-2001
96       leaves  these  aspects of signal() unspecified.  See signal(2) for fur‐
97       ther details.
98
99       In order to wait for a signal, BSD and System V both provided  a  func‐
100       tion  named  sigpause(3), but this function has a different argument on
101       the two systems.  See sigpause(3) for details.
102

BUGS

104       In versions of glibc before 2.2, sigset() did not unblock sig  if  disp
105       was specified as a value other than SIG_HOLD.
106
107       In versions of glibc before 2.5, sigset() does not correctly return the
108       previous disposition of the signal in two cases.   First,  if  disp  is
109       specified  as  SIG_HOLD,  then  a  successful  sigset()  always returns
110       SIG_HOLD.  Instead, it should return the previous  disposition  of  the
111       signal (unless the signal was blocked, in which case SIG_HOLD should be
112       returned).  Second, if the signal is currently blocked, then the return
113       value of a successful sigset() should be SIG_HOLD.  Instead, the previ‐
114       ous disposition of the signal is returned.  These  problems  have  been
115       fixed since glibc 2.5.
116

SEE ALSO

118       kill(2),  pause(2),  sigaction(2), signal(2), sigprocmask(2), raise(3),
119       sigpause(3), sigvec(3), signal(7)
120

COLOPHON

122       This page is part of release 3.53 of the Linux  man-pages  project.   A
123       description  of  the project, and information about reporting bugs, can
124       be found at http://www.kernel.org/doc/man-pages/.
125
126
127
128Linux                             2010-09-20                         SIGSET(3)
Impressum