2 .\" Copyright (C) 2002 Chad David <davidc@FreeBSD.org>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice(s), this list of conditions and the following disclaimer as
9 .\" the first lines of this file unmodified other than the possible
10 .\" addition of one or more copyright notices.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice(s), this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 .\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
60 .Nd "kernel signal functions"
66 .Fn SIGADDSET "sigset_t set" "int signo"
68 .Fn SIGDELSET "sigset_t set" "int signo"
70 .Fn SIGEMPTYSET "sigset_t set"
72 .Fn SIGFILLSET "sigset_t set"
74 .Fn SIGISMEMBER "sigset_t set" "int signo"
76 .Fn SIGISEMPTY "sigset_t set"
78 .Fn SIGNOTEMPTY "sigset_t set"
80 .Fn SIGSETEQ "sigset_t set1" "sigset_t set2"
82 .Fn SIGSETNEQ "sigset_t set1" "sigset_t set2"
84 .Fn SIGSETOR "sigset_t set1" "sigset_t set2"
86 .Fn SIGSETAND "sigset_t set1" "sigset_t set2"
88 .Fn SIGSETNAND "sigset_t set1" "sigset_t set2"
90 .Fn SIG_CANTMASK "sigset_t set"
92 .Fn SIG_STOPSIGMASK "sigset_t set"
94 .Fn SIG_CONTSIGMASK "sigset_t set"
96 .Fn SIGPENDING "struct proc *p"
98 .Fn cursig "struct thread *td"
100 .Fn execsigs "struct proc *p"
102 .Fn issignal "struct thread *td"
104 .Fn killproc "struct proc *p" "char *why"
106 .Fn pgsigio "struct sigio **sigiop" "int sig" "int checkctty"
108 .Fn postsig "int sig"
110 .Fn sigexit "struct thread *td" "int signum"
112 .Fn siginit "struct proc *p"
114 .Fn signotify "struct thread *td"
116 .Fn trapsignal "struct thread *td" "int sig" "u_long code"
124 No effort is made to ensure that
126 is a valid signal number.
134 No effort is made to ensure that
136 is a valid signal number.
140 macro clears all signals in
145 macro sets all signals in
159 does not have any signals set.
169 macro determines if two signal sets are equal; that is, the same signals
174 macro determines if two signal sets differ; that is, if any signal set in
175 one is not set in the other.
179 macro ORs the signals set in
186 macro ANDs the signals set in
193 macro NANDs the signals set in
206 These two signals cannot be blocked or caught and
208 is used in code where signals are manipulated to ensure this policy
222 is used to clear stop signals when a process is waiting for a child to
223 exit or exec, and when a process is continuing after having been
233 is called when a process is stopped.
237 macro determines if the given process has any pending signals that are
239 If the process has a pending signal and the process is currently being
242 will return true even if the signal is masked.
246 function returns the signal number that should be delivered to process
248 If there are no signals pending, zero is returned.
252 function resets the signal set and signal stack of a process in preparation
263 function determines if there are any pending signals for process
265 that should be caught, or cause this process to terminate or interrupt its
269 is currently being traced, ignored signals will be handled and the process
271 Stop signals are handled and cleared right away by
273 unless the process is a member of an orphaned process group and the stop
274 signal originated from a TTY.
277 lock may be acquired and released, and if
279 is held, it may be released and reacquired.
283 .Fa td->td_proc->p_sigacts
284 must be locked before calling
286 and may be released and reacquired during the call.
289 must be acquired before calling
291 and may be released and reacquired during the call.
292 The lock for the parent of
294 may also be acquired and released.
295 Default signal actions are not taken for system processes and init.
304 is logged as the reason
306 the process was killed.
310 function sends the signal
312 to the process or process group
313 .Fa sigiop->sio_pgid .
316 is non-zero, the signal is only delivered to processes in the process group
317 that have a controlling terminal.
320 is for a process (> 0), the lock for
322 is acquired and released.
325 is for a process group (< 0), the process group lock for
327 is acquired and released.
330 is acquired and released.
334 function handles the actual delivery of the signal
339 after the kernel has been notified that a signal should be delivered
342 which causes the flag
345 The lock for process that owns
349 is called, and the current process cannot be 0.
352 field of the current process must be held before
354 is called, and may be released and reacquired.
358 function causes the process that owns
360 to exit with a return value of signal number
362 If required, the process will dump core.
363 The lock for the process that owns
371 function is called during system initialization to cause every signal with
372 a default property of
380 is acquired and released by
382 The only process that
390 function flags that there are unmasked signals pending that
399 is acquired and released.
403 function sends a signal that is the result of a trap to process
405 If the process is not being traced and the signal can be delivered
408 will deliver it directly; otherwise,
412 to cause the signal to be delivered.
415 lock is acquired and released, as is the lock for
421 is acquired and released.
431 macros all return non-zero (true) if the condition they are checking
432 is found to be true; otherwise, zero (false) is returned.
436 function returns either a valid signal number or zero.
439 returns either a valid signal number or zero.
445 This manual page was written by
446 .An Chad David Aq davidc@FreeBSD.org .