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.
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

NOTES

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

BUGS

94       In  versions  of glibc before 2.2, sigset() did not unblock sig if disp
95       was specified as a value other than SIG_HOLD.
96
97       In all versions of glibc up to and including 2.3.5, sigset()  does  not
98       correctly  return  the previous disposition of the signal in two cases.
99       First, if disp is specified as SIG_HOLD,  then  a  successful  sigset()
100       always returns SIG_HOLD.  Instead, it should return the previous dispo‐
101       sition of the signal (unless the signal  was  blocked,  in  which  case
102       SIG_HOLD  should  be  returned).   Second,  if  the signal is currently
103       blocked, then the return value  of  a  successful  sigset()  should  be
104       SIG_HOLD.  Instead, the previous disposition of the signal is returned.
105

CONFORMING TO

107       SVr4,  POSIX.1-2001.   These functions are obsolete: do not use them in
108       new programs.
109

SEE ALSO

111       kill(2), pause(2), sigaction(2), signal(2),  sigprocmask(2),  raise(3),
112       sigpause(3), sigvec(3), feature_test_macros(7), signal(7)
113
114
115
116Linux 2.6.14                      2005-12-01                         SIGSET(3)
Impressum