1SIGHOLD(P) POSIX Programmer's Manual SIGHOLD(P)
2
3
4
6 sighold, sigignore, sigpause, sigrelse, sigset - signal management
7
9 #include <signal.h>
10
11 int sighold(int sig);
12 int sigignore(int sig);
13 int sigpause(int sig);
14 int sigrelse(int sig);
15 void (*sigset(int sig, void (*disp)(int)))(int);
16
17
19 Use of any of these functions is unspecified in a multi-threaded
20 process.
21
22 The sighold(), sigignore(), sigpause(), sigrelse(), and sigset() func‐
23 tions provide simplified signal management.
24
25 The sigset() function shall modify signal dispositions. The sig argu‐
26 ment specifies the signal, which may be any signal except SIGKILL and
27 SIGSTOP. The disp argument specifies the signal's disposition, which
28 may be SIG_DFL, SIG_IGN, or the address of a signal handler. If
29 sigset() is used, and disp is the address of a signal handler, the sys‐
30 tem shall add sig to the calling process' signal mask before executing
31 the signal handler; when the signal handler returns, the system shall
32 restore the calling process' signal mask to its state prior to the
33 delivery of the signal. In addition, if sigset() is used, and disp is
34 equal to SIG_HOLD, sig shall be added to the calling process' signal
35 mask and sig's disposition shall remain unchanged. If sigset() is used,
36 and disp is not equal to SIG_HOLD, sig shall be removed from the call‐
37 ing process' signal mask.
38
39 The sighold() function shall add sig to the calling process' signal
40 mask.
41
42 The sigrelse() function shall remove sig from the calling process' sig‐
43 nal mask.
44
45 The sigignore() function shall set the disposition of sig to SIG_IGN.
46
47 The sigpause() function shall remove sig from the calling process' sig‐
48 nal mask and suspend the calling process until a signal is received.
49 The sigpause() function shall restore the process' signal mask to its
50 original state before returning.
51
52 If the action for the SIGCHLD signal is set to SIG_IGN, child processes
53 of the calling processes shall not be transformed into zombie processes
54 when they terminate. If the calling process subsequently waits for its
55 children, and the process has no unwaited-for children that were trans‐
56 formed into zombie processes, it shall block until all of its children
57 terminate, and wait(), waitid(), and waitpid() shall fail and set errno
58 to [ECHILD].
59
61 Upon successful completion, sigset() shall return SIG_HOLD if the sig‐
62 nal had been blocked and the signal's previous disposition if it had
63 not been blocked. Otherwise, SIG_ERR shall be returned and errno set to
64 indicate the error.
65
66 The sigpause() function shall suspend execution of the thread until a
67 signal is received, whereupon it shall return -1 and set errno to
68 [EINTR].
69
70 For all other functions, upon successful completion, 0 shall be
71 returned. Otherwise, -1 shall be returned and errno set to indicate
72 the error.
73
75 These functions shall fail if:
76
77 EINVAL The sig argument is an illegal signal number.
78
79
80 The sigset() and sigignore() functions shall fail if:
81
82 EINVAL An attempt is made to catch a signal that cannot be caught, or
83 to ignore a signal that cannot be ignored.
84
85
86 The following sections are informative.
87
89 None.
90
92 The sigaction() function provides a more comprehensive and reliable
93 mechanism for controlling signals; new applications should use sigac‐
94 tion() rather than sigset().
95
96 The sighold() function, in conjunction with sigrelse() or sigpause(),
97 may be used to establish critical regions of code that require the
98 delivery of a signal to be temporarily deferred.
99
100 The sigsuspend() function should be used in preference to sigpause()
101 for broader portability.
102
104 None.
105
107 None.
108
110 Signal Concepts , exec() , pause() , sigaction() , signal() , sigsus‐
111 pend() , waitid() , the Base Definitions volume of
112 IEEE Std 1003.1-2001, <signal.h>
113
115 Portions of this text are reprinted and reproduced in electronic form
116 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
117 -- Portable Operating System Interface (POSIX), The Open Group Base
118 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
119 Electrical and Electronics Engineers, Inc and The Open Group. In the
120 event of any discrepancy between this version and the original IEEE and
121 The Open Group Standard, the original IEEE and The Open Group Standard
122 is the referee document. The original Standard can be obtained online
123 at http://www.opengroup.org/unix/online.html .
124
125
126
127IEEE/The Open Group 2003 SIGHOLD(P)