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

NAME

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

SYNOPSIS

9       #define _XOPEN_SOURCE 500
10       #include <signal.h>
11
12       typedef void (*sighandler_t)(int);
13
14       sighandler_t sigset(int sig, sighandler_t disp);
15
16       int sighold(int sig);
17
18       int sigrelse(int sig);
19
20       int sigignore(int sig);
21

DESCRIPTION

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

RETURN VALUE

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

ERRORS

68       For sigset() see the ERRORS under sigaction(2) and sigprocmask(2).
69
70       For sighold() and sigrelse() see the ERRORS under sigprocmask(2).
71
72       For sigignore(), see the errors under sigaction(2).
73

CONFORMING TO

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

NOTES

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

BUGS

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

SEE ALSO

114       kill(2),  pause(2),  sigaction(2), signal(2), sigprocmask(2), raise(3),
115       sigpause(3), sigvec(3), feature_test_macros(7), signal(7)
116

COLOPHON

118       This page is part of release 3.25 of the Linux  man-pages  project.   A
119       description  of  the project, and information about reporting bugs, can
120       be found at http://www.kernel.org/doc/man-pages/.
121
122
123
124Linux                             2009-03-15                         SIGSET(3)
Impressum