1SIGHOLD(3P)                POSIX Programmer's Manual               SIGHOLD(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       sighold, sigignore, sigpause, sigrelse, sigset - signal management
13

SYNOPSIS

15       #include <signal.h>
16
17       int sighold(int sig);
18       int sigignore(int sig);
19       int sigpause(int sig);
20       int sigrelse(int sig);
21       void (*sigset(int sig, void (*disp)(int)))(int);
22
23

DESCRIPTION

25       Use of any of  these  functions  is  unspecified  in  a  multi-threaded
26       process.
27
28       The  sighold(), sigignore(), sigpause(), sigrelse(), and sigset() func‐
29       tions provide simplified signal management.
30
31       The sigset() function shall modify signal dispositions. The  sig  argu‐
32       ment  specifies  the signal, which may be any signal except SIGKILL and
33       SIGSTOP. The disp argument specifies the  signal's  disposition,  which
34       may  be  SIG_DFL,  SIG_IGN,  or  the  address  of  a signal handler. If
35       sigset() is used, and disp is the address of a signal handler, the sys‐
36       tem  shall add sig to the calling process' signal mask before executing
37       the signal handler; when the signal handler returns, the  system  shall
38       restore  the  calling  process'  signal  mask to its state prior to the
39       delivery of the signal. In addition, if sigset() is used, and  disp  is
40       equal  to  SIG_HOLD,  sig shall be added to the calling process' signal
41       mask and sig's disposition shall remain unchanged. If sigset() is used,
42       and  disp is not equal to SIG_HOLD, sig shall be removed from the call‐
43       ing process' signal mask.
44
45       The sighold() function shall add sig to  the  calling  process'  signal
46       mask.
47
48       The sigrelse() function shall remove sig from the calling process' sig‐
49       nal mask.
50
51       The sigignore() function shall set the disposition of sig to SIG_IGN.
52
53       The sigpause() function shall remove sig from the calling process' sig‐
54       nal  mask  and  suspend the calling process until a signal is received.
55       The sigpause() function shall restore the process' signal mask  to  its
56       original state before returning.
57
58       If the action for the SIGCHLD signal is set to SIG_IGN, child processes
59       of the calling processes shall not be transformed into zombie processes
60       when  they terminate. If the calling process subsequently waits for its
61       children, and the process has no unwaited-for children that were trans‐
62       formed  into zombie processes, it shall block until all of its children
63       terminate, and wait(), waitid(), and waitpid() shall fail and set errno
64       to [ECHILD].
65

RETURN VALUE

67       Upon  successful completion, sigset() shall return SIG_HOLD if the sig‐
68       nal had been blocked and the signal's previous disposition  if  it  had
69       not been blocked. Otherwise, SIG_ERR shall be returned and errno set to
70       indicate the error.
71
72       The sigpause() function shall suspend execution of the thread  until  a
73       signal  is  received,  whereupon  it  shall  return -1 and set errno to
74       [EINTR].
75
76       For all  other  functions,  upon  successful  completion,  0  shall  be
77       returned.   Otherwise,  -1  shall be returned and errno set to indicate
78       the error.
79

ERRORS

81       These functions shall fail if:
82
83       EINVAL The sig argument is an illegal signal number.
84
85
86       The sigset() and sigignore() functions shall fail if:
87
88       EINVAL An attempt is made to catch a signal that cannot be  caught,  or
89              to ignore a signal that cannot be ignored.
90
91
92       The following sections are informative.
93

EXAMPLES

95       None.
96

APPLICATION USAGE

98       The  sigaction()  function  provides  a more comprehensive and reliable
99       mechanism for controlling signals; new applications should  use  sigac‐
100       tion() rather than sigset().
101
102       The  sighold()  function, in conjunction with sigrelse() or sigpause(),
103       may be used to establish critical regions  of  code  that  require  the
104       delivery of a signal to be temporarily deferred.
105
106       The  sigsuspend()  function  should be used in preference to sigpause()
107       for broader portability.
108

RATIONALE

110       None.
111

FUTURE DIRECTIONS

113       None.
114

SEE ALSO

116       Signal Concepts, exec(), pause(), sigaction(), signal(),  sigsuspend(),
117       waitid(),  the  Base  Definitions volume of IEEE Std 1003.1-2001, <sig‐
118       nal.h>
119
121       Portions of this text are reprinted and reproduced in  electronic  form
122       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
123       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
124       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
125       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
126       event of any discrepancy between this version and the original IEEE and
127       The Open Group Standard, the original IEEE and The Open Group  Standard
128       is  the  referee document. The original Standard can be obtained online
129       at http://www.opengroup.org/unix/online.html .
130
131
132
133IEEE/The Open Group                  2003                          SIGHOLD(3P)
Impressum