xref: /netbsd-src/share/man/man7/signal.7 (revision 17cc32643c5fbca4f3537ec12b464c8c5fda239b)
1*17cc3264Sriastradh.\"	$NetBSD: signal.7,v 1.28 2023/07/17 14:20:19 riastradh Exp $
2aef7e0d5Sjdolecek.\"
3ff45d31fSdholland.\" Copyright (c) 1999, 2016 The NetBSD Foundation, Inc.
4aef7e0d5Sjdolecek.\" All rights reserved.
5aef7e0d5Sjdolecek.\"
6aef7e0d5Sjdolecek.\" Redistribution and use in source and binary forms, with or without
7aef7e0d5Sjdolecek.\" modification, are permitted provided that the following conditions
8aef7e0d5Sjdolecek.\" are met:
9aef7e0d5Sjdolecek.\" 1. Redistributions of source code must retain the above copyright
10aef7e0d5Sjdolecek.\"    notice, this list of conditions and the following disclaimer.
11aef7e0d5Sjdolecek.\" 2. Redistributions in binary form must reproduce the above copyright
12aef7e0d5Sjdolecek.\"    notice, this list of conditions and the following disclaimer in the
13aef7e0d5Sjdolecek.\"    documentation and/or other materials provided with the distribution.
14aef7e0d5Sjdolecek.\"
15aef7e0d5Sjdolecek.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16aef7e0d5Sjdolecek.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17aef7e0d5Sjdolecek.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18aef7e0d5Sjdolecek.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19aef7e0d5Sjdolecek.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20aef7e0d5Sjdolecek.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21aef7e0d5Sjdolecek.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22aef7e0d5Sjdolecek.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23aef7e0d5Sjdolecek.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24aef7e0d5Sjdolecek.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25aef7e0d5Sjdolecek.\" POSSIBILITY OF SUCH DAMAGE.
26aef7e0d5Sjdolecek.\"
273ed1486eSdholland.Dd August 24, 2018
28aef7e0d5Sjdolecek.Dt SIGNAL 7
29aef7e0d5Sjdolecek.Os
30aef7e0d5Sjdolecek.Sh NAME
31aef7e0d5Sjdolecek.Nm signal
32aef7e0d5Sjdolecek.Nd signal facilities
33aef7e0d5Sjdolecek.Sh DESCRIPTION
34bb5b28e6SdhollandA
35bb5b28e6Sdholland.Nm
36bb5b28e6Sdhollandis a system-level notification delivered to a process.
37bb5b28e6SdhollandSignals may be generated as the result of process activity, by certain
38bb5b28e6Sdhollanduser inputs, by kernel facilities or subsystems, or sent
39bb5b28e6Sdhollandprogrammatically by other processes or by users.
40bb5b28e6SdhollandThere is a small fixed set of signals, each with a symbolic name and a
41bb5b28e6Sdhollandnumber.
42bb5b28e6SdhollandFor historical reasons many of the numbers are ``well-known values'',
43bb5b28e6Sdhollandwhich are in practice the same on all implementations and
44bb5b28e6Sdhollandrealistically can never be changed.
45bb5b28e6Sdholland(Nonetheless, compiled code should always use only the symbolic
46bb5b28e6Sdhollandnames.)
47bb5b28e6SdhollandMany/most signals also have specific semantics, both in how they can
48bb5b28e6Sdhollandbe generated and in their effects.
49bb5b28e6SdhollandSome are special cases in ways that have quite far-reaching
50bb5b28e6Sdhollandconsequences.
51aef7e0d5Sjdolecek.Pp
52bb5b28e6SdhollandWhen a signal is
53bb5b28e6Sdholland.Em posted
54bb5b28e6Sdholland.Pq Dq sent
55bb5b28e6Sdhollandto a process, in general any of several things can happen.
56bb5b28e6SdhollandIf the process has elected to
57bb5b28e6Sdholland.Em ignore
58bb5b28e6Sdhollandthe signal, it is discarded and nothing happens.
59bb5b28e6Sdholland(Some signals may not be ignored, however.)
60bb5b28e6SdhollandIf the process has elected to
61bb5b28e6Sdholland.Em block
62bb5b28e6Sdhollandthe signal temporarily, delivery is postponed until the process
63bb5b28e6Sdhollandlater unblocks that signal.
64bb5b28e6SdhollandOtherwise, the signal is
65bb5b28e6Sdholland.Em delivered ,
66bb5b28e6Sdhollandmeaning that whatever the process is doing is interrupted in order to
67bb5b28e6Sdhollandreact to the signal.
68bb5b28e6Sdholland(Note that processes that are waiting in the kernel must unwind what
69bb5b28e6Sdhollandthey are doing for signals to be delivered.
70bb5b28e6SdhollandThis can sometimes be expensive.
71bb5b28e6SdhollandSee
72bb5b28e6Sdholland.Xr sigaction 2
73bb5b28e6Sdhollandfor further information.)
74bb5b28e6Sdholland.Pp
75bb5b28e6SdhollandIf the process has elected to
76bb5b28e6Sdholland.Em catch
77bb5b28e6Sdhollandthe signal, which means that the process has installed a handler to
78bb5b28e6Sdhollandreact to the signal in some process-specific way, the kernel arranges
79bb5b28e6Sdhollandfor the process's handler logic to be invoked.
80bb5b28e6SdhollandThis is always done in a way that allows the process to resume if
81bb5b28e6Sdhollanddesired.
82bb5b28e6Sdholland(Note, however, that some signals may not be caught.)
83bb5b28e6SdhollandOtherwise, the default action for the signal is taken.
843ed1486eSdhollandFor most signals the default action is to terminate the process and
853ed1486eSdhollandgenerate a core dump.
86bb5b28e6SdhollandSee the table below.
87bb5b28e6SdhollandNote that the term
88bb5b28e6Sdholland.Em delivery
89bb5b28e6Sdhollandis also used for the specific process of arranging for a signal
90bb5b28e6Sdhollandhandler to be invoked.
91bb5b28e6Sdholland.Pp
92bb5b28e6SdhollandIn general, signals are delivered as soon as they are posted.
93bb5b28e6Sdholland(Some delays may occur due to scheduling.)
94bb5b28e6SdhollandHowever, in some cases a process that has been sleeping in the kernel
95bb5b28e6Sdhollandmay need to do slow things as part of unwinding its state; this can
96bb5b28e6Sdhollandsometimes lead to human-perceptible delays.
97bb5b28e6Sdholland.Pp
98bb5b28e6SdhollandAlso, some sleep states within the kernel are
99bb5b28e6Sdholland.Em uninterruptible
100bb5b28e6Sdhollandmeaning that signals posted will have no effect until the state
101bb5b28e6Sdhollandclears.
102bb5b28e6SdhollandThese states are supposed to be short-term only, but sometimes kernel
103bb5b28e6Sdhollandbugs make this not the case and one can end up with unkillable
104bb5b28e6Sdhollandprocesses.
105bb5b28e6SdhollandSuch processes appear in state "D" in
106bb5b28e6Sdholland.Xr ps 1 .
107bb5b28e6SdhollandIn general the only way to get rid of them is to reboot.
108bb5b28e6Sdholland(However, when the "wchan" reported is "tstile", it means the process
109bb5b28e6Sdhollandis waiting for some other process to release resources; sometimes if
110bb5b28e6Sdhollandone can find and kill that process the situation is recoverable.)
111bb5b28e6Sdholland.Ss Signal list
112bb5b28e6SdhollandThe following signals are defined in
113bb5b28e6Sdholland.Nx :
114bb5b28e6Sdholland.Pp
115f7cc37edSwiz.Bl -column ".Sy SIGVTALRM" 3n "Profiling timer expired blablabla" -compact
116f7cc37edSwiz.\".It Sy "Symbol" Ta No Ta Sy "Descriptive name"
117f7cc37edSwiz.It Dv SIGHUP Ta 1 Ta "Hangup"
118f7cc37edSwiz.It Dv SIGINT Ta 2 Ta "Interrupt"
119f7cc37edSwiz.It Dv SIGQUIT Ta 3 Ta "Quit"
120f7cc37edSwiz.It Dv SIGILL Ta 4 Ta "Illegal instruction"
121f7cc37edSwiz.It Dv SIGTRAP Ta 5 Ta "Trace/BPT trap"
122f7cc37edSwiz.It Dv SIGABRT Ta 6 Ta "Abort trap"
123f7cc37edSwiz.It Dv SIGEMT Ta 7 Ta "EMT trap"
124f7cc37edSwiz.It Dv SIGFPE Ta 8 Ta "Floating point exception"
125f7cc37edSwiz.It Dv SIGKILL Ta 9 Ta "Killed"
126f7cc37edSwiz.It Dv SIGBUS Ta 10 Ta "Bus error"
127f7cc37edSwiz.It Dv SIGSEGV Ta 11 Ta "Segmentation fault"
128f7cc37edSwiz.It Dv SIGSYS Ta 12 Ta "Bad system call"
129f7cc37edSwiz.It Dv SIGPIPE Ta 13 Ta "Broken pipe"
130f7cc37edSwiz.It Dv SIGALRM Ta 14 Ta "Alarm clock"
131f7cc37edSwiz.It Dv SIGTERM Ta 15 Ta "Terminated"
132f7cc37edSwiz.It Dv SIGURG Ta 16 Ta "Urgent I/O condition"
133f7cc37edSwiz.It Dv SIGSTOP Ta 17 Ta "Suspended (signal)"
134f7cc37edSwiz.It Dv SIGTSTP Ta 18 Ta "Suspended"
135f7cc37edSwiz.It Dv SIGCONT Ta 19 Ta "Continued"
136f7cc37edSwiz.It Dv SIGCHLD Ta 20 Ta "Child exited, stopped or continued"
137f7cc37edSwiz.It Dv SIGTTIN Ta 21 Ta "Stopped (tty input)"
138f7cc37edSwiz.It Dv SIGTTOU Ta 22 Ta "Stopped (tty output)"
139f7cc37edSwiz.It Dv SIGIO Ta 23 Ta "I/O possible"
140f7cc37edSwiz.It Dv SIGXCPU Ta 24 Ta "CPU time limit exceeded"
141f7cc37edSwiz.It Dv SIGXFSZ Ta 25 Ta "File size limit exceeded"
142f7cc37edSwiz.It Dv SIGVTALRM Ta 26 Ta "Virtual timer expired"
143f7cc37edSwiz.It Dv SIGPROF Ta 27 Ta "Profiling timer expired"
144f7cc37edSwiz.It Dv SIGWINCH Ta 28 Ta "Window size changed"
145f7cc37edSwiz.It Dv SIGINFO Ta 29 Ta "Information request"
146f7cc37edSwiz.It Dv SIGUSR1 Ta 30 Ta "User defined signal 1"
147f7cc37edSwiz.It Dv SIGUSR2 Ta 31 Ta "User defined signal 2"
148f7cc37edSwiz.It Dv SIGPWR Ta 32 Ta "Power fail/restart"
149aef7e0d5Sjdolecek.El
150cc333b3dSlha.Pp
151bb5b28e6SdhollandThese are numbered 1 to 32.
152bb5b28e6Sdholland(There is no signal 0; 0 is a reserved value that can be used as a
153bb5b28e6Sdhollandno-op with some signal operations.)
154cc333b3dSlha.Pp
155bb5b28e6SdhollandDetailed descriptions of these signals follow.
156bb5b28e6Sdholland.Bl -tag -width "aaa"
157bb5b28e6Sdholland.\" ************
158e46faeedSwiz.It Dv SIGHUP No (Hangup)
1597f402ed8SuweThis signal is generated by the
160c1474446Swiz.Xr tty 4
1617f402ed8Suwedriver
162bb5b28e6Sdhollandto indicate a hangup condition on a process's controlling terminal:
163bb5b28e6Sdhollandthe user has disconnected.
164bb5b28e6SdhollandAccordingly, the default action is to terminate the process.
165bb5b28e6SdhollandThis signal is also used by many daemons,
166bb5b28e6Sdhollandsuch as
167bb5b28e6Sdholland.Xr inetd 8 ,
168bb5b28e6Sdhollandas a cue to reload configuration.
169bb5b28e6SdhollandThe number for
170bb5b28e6Sdholland.Dv SIGHUP
17151b70d09Suweis\~1, which is quite well known.
172bb5b28e6Sdholland.\" ************
173e46faeedSwiz.It Dv SIGINT No (Interrupt)
1747f402ed8SuweThis signal is generated by the
175bb5b28e6Sdholland.Xr tty 4
1767f402ed8Suwedriver
177bb5b28e6Sdhollandwhen the user presses the interrupt character, normally control-C.
178bb5b28e6SdhollandThe default action is to terminate the process.
179bb5b28e6SdhollandThe number for
180bb5b28e6Sdholland.Dv SIGINT
18151b70d09Suweis\~2.
182bb5b28e6Sdholland.\" ************
183e46faeedSwiz.It Dv SIGQUIT No (Quit)
1847f402ed8SuweThis signal is generated by the
185bb5b28e6Sdholland.Xr tty 4
1867f402ed8Suwedriver
187bb5b28e6Sdhollandwhen the user presses the quit character, normally control-backspace.
188bb5b28e6SdhollandThe default action is to terminate the process and dump core.
189bb5b28e6SdhollandThe number for
190bb5b28e6Sdholland.Dv SIGQUIT
19151b70d09Suweis\~3.
192bb5b28e6Sdholland.\" ************
193e46faeedSwiz.It Dv SIGILL No (Illegal instruction)
194bb5b28e6SdhollandThis signal is generated synchronously by the kernel when the process
195bb5b28e6Sdhollandexecutes an invalid instruction.
196bb5b28e6SdhollandThe default action is to terminate the process and dump core.
197bb5b28e6SdhollandNote: the results of executing an illegal instruction when
198bb5b28e6Sdholland.Dv SIGILL
199bb5b28e6Sdhollandis blocked or ignored are formally unspecified.
200bb5b28e6SdhollandThe number for
201bb5b28e6Sdholland.Dv SIGILL
20251b70d09Suweis\~4.
203bb5b28e6Sdholland.\" ************
204e46faeedSwiz.It Dv SIGTRAP No (Trace/BPT trap)
205bb5b28e6SdhollandThis signal is used when a process is being traced
206bb5b28e6Sdholland(see
207bb5b28e6Sdholland.Xr ptrace 2 )
208bb5b28e6Sdhollandto indicate that the process has stopped at a breakpoint or after
209bb5b28e6Sdhollandsingle-stepping.
210bb5b28e6SdhollandIt is normally intercepted by the debugger and not exposed to the
211bb5b28e6Sdhollanddebuggee.
212bb5b28e6SdhollandThe default action is to terminate the process and dump core.
213bb5b28e6SdhollandThe number for
214bb5b28e6Sdholland.Dv SIGTRAP
21551b70d09Suweis\~5.
216bb5b28e6Sdholland.\" ************
217e46faeedSwiz.It Dv SIGABRT No (Abort trap)
218bb5b28e6SdhollandThis signal is generated when the
219bb5b28e6Sdholland.Xr abort 3
220bb5b28e6Sdhollandstandard library function is called.
221bb5b28e6SdhollandThe default action is to terminate the process and dump core.
222bb5b28e6SdhollandThe number for
223bb5b28e6Sdholland.Dv SIGABRT
22451b70d09Suweis\~6.
225bb5b28e6SdhollandThis number was also formerly used for
226bb5b28e6Sdholland.Dv SIGIOT ,
2278ea76f39Skamilwhich is no longer defined,
2288ea76f39Skamilas it was specific to the PDP-11 instruction
2298ea76f39Skamil.Dv iot .
230bb5b28e6Sdholland.\" ************
231e46faeedSwiz.It Dv SIGEMT No (EMT trap)
232bb5b28e6SdhollandIn theory this signal is generated when an instruction needs to be
233bb5b28e6Sdhollandemulated.
234bb5b28e6Sdholland.\"   XXX expand this -- I don't know, grep isn't helping much and
235bb5b28e6Sdholland.\"   information seems pretty thin on the ground on the net.
236bb5b28e6SdhollandThe default action is to terminate the process and dump core.
237bb5b28e6SdhollandThe number for
238bb5b28e6Sdholland.Dv SIGEMT
23951b70d09Suweis\~7.
240bb5b28e6Sdholland.\" ************
241e46faeedSwiz.It Dv SIGFPE No (Floating point exception)
242bb5b28e6SdhollandThis signal is generated when an invalid floating point operation is
243bb5b28e6Sdhollanddetected by hardware or by a soft-float library.
244bb5b28e6SdhollandThe default action is to terminate the process and dump core.
245bb5b28e6SdhollandThe number for
246bb5b28e6Sdholland.Dv SIGFPE
24751b70d09Suweis\~8.
248bb5b28e6Sdholland.\" ************
249e46faeedSwiz.It Dv SIGKILL No (Killed)
250bb5b28e6SdhollandThis signal cannot be caught or ignored.
251bb5b28e6SdhollandThe (unconditional) action is to terminate the process.
252bb5b28e6SdhollandIt is most often sent by system administrators, but is also generated
253bb5b28e6Sdhollandby the kernel in response to running completely out of memory and
254bb5b28e6Sdhollandswap space.
255bb5b28e6SdhollandNote that because many processes need to perform cleanup before
256bb5b28e6Sdhollandexiting, it is usually best (as a user or administrator) to not deploy
257bb5b28e6Sdholland.Dv SIGKILL
258bb5b28e6Sdhollanduntil a process has failed to respond to other signals.
259bb5b28e6SdhollandThe number for
260bb5b28e6Sdholland.Dv SIGKILL
26151b70d09Suweis\~9, which is extremely well known.
262bb5b28e6Sdholland.\" ************
263e46faeedSwiz.It Dv SIGBUS No (Bus error)
264bb5b28e6SdhollandThis signal is generated synchronously by the kernel when the process
265bb5b28e6Sdhollandperforms certain kinds of invalid memory accesses.
266bb5b28e6SdhollandThe most common cause of
267bb5b28e6Sdholland.Dv SIGBUS
268bb5b28e6Sdhollandis an unaligned memory access; however, on some architectures it may
269bb5b28e6Sdhollandcover other memory conditions, such as attempts to access memory
270bb5b28e6Sdhollandbelonging to the kernel.
271bb5b28e6SdhollandThe default action is to terminate the process and dump core.
272bb5b28e6SdhollandNote: the results of performing such invalid accesses when
273bb5b28e6Sdholland.Dv SIGBUS
274bb5b28e6Sdhollandis blocked or ignored are formally unspecified.
275bb5b28e6SdhollandThe number for
276bb5b28e6Sdholland.Dv SIGBUS
27751b70d09Suweis\~10.
278bb5b28e6Sdholland.\" ************
279e46faeedSwiz.It Dv SIGSEGV No (Segmentation fault)
280bb5b28e6SdhollandThis signal is generated synchronously by the kernel when the process
281bb5b28e6Sdhollandattempts to access unmapped memory, or access memory in a manner that
282bb5b28e6Sdhollandthe protection settings for that memory region do not permit.
283bb5b28e6SdhollandOn some architectures other assorted permission or protection errors
284bb5b28e6Sdhollandalso yield
285bb5b28e6Sdholland.Dv SIGSEGV .
286bb5b28e6SdhollandOn
287bb5b28e6Sdholland.Nx ,
288bb5b28e6Sdhollandpassing invalid pointers to system calls will yield failure with
289bb5b28e6Sdholland.Er EFAULT
290bb5b28e6Sdhollandbut not also
291bb5b28e6Sdholland.Dv SIGSEGV .
292bb5b28e6SdhollandThe default action is to terminate the process and dump core.
293bb5b28e6SdhollandNote: the results of an invalid memory access when
294bb5b28e6Sdholland.Dv SIGSEGV
295bb5b28e6Sdhollandis blocked or ignored are formally unspecified.
296bb5b28e6SdhollandThe number for
297bb5b28e6Sdholland.Dv SIGSEGV
29851b70d09Suweis\~11, which is very well known.
299bb5b28e6Sdholland.\" ************
300e46faeedSwiz.It Dv SIGSYS No (Bad system call)
301bb5b28e6SdhollandThis signal is generated by the kernel, in addition to failing with
302bb5b28e6Sdholland.Er ENOSYS ,
303bb5b28e6Sdhollandwhen a system call is made using an invalid system call number.
304bb5b28e6Sdholland.\" (This facility was intended to facilitate emulation of system calls.)
305bb5b28e6SdhollandThe default action is to terminate the process and dump core.
306bb5b28e6SdhollandThe number for
307bb5b28e6Sdholland.Dv SIGSYS
30851b70d09Suweis\~12.
309bb5b28e6Sdholland.\" ************
310e46faeedSwiz.It Dv SIGPIPE No (Broken pipe)
311bb5b28e6SdhollandThis signal is generated by the kernel, in addition to failing with
312bb5b28e6Sdholland.Er EPIPE ,
313bb5b28e6Sdhollandwhen a
314bb5b28e6Sdholland.Xr write 2
315bb5b28e6Sdhollandcall or similar is made on a pipe or socket that has been closed and
316bb5b28e6Sdhollandhas no readers.
317bb5b28e6SdhollandThe default action is to terminate the process.
318bb5b28e6SdhollandThe number for
319bb5b28e6Sdholland.Dv SIGPIPE
32051b70d09Suweis\~13.
321bb5b28e6Sdholland.\" ************
322e46faeedSwiz.It Dv SIGALRM No (Alarm clock)
323bb5b28e6SdhollandThis signal is generated by the kernel when a real-time timer expires.
324bb5b28e6SdhollandSee
325bb5b28e6Sdholland.Xr alarm 3 ,
326bb5b28e6Sdholland.Xr setitimer 2 ,
327bb5b28e6Sdhollandand
328bb5b28e6Sdholland.Xr timer_settime 2 .
329bb5b28e6SdhollandThe default action is to terminate the process.
330bb5b28e6SdhollandThe number for
331bb5b28e6Sdholland.Dv SIGALRM
33251b70d09Suweis\~14.
333bb5b28e6Sdholland.\" ************
334e46faeedSwiz.It Dv SIGTERM No (Terminated)
335bb5b28e6SdhollandThis signal is the default signal sent by
336bb5b28e6Sdholland.Xr kill 1
337bb5b28e6Sdhollandand represents a user or administrator request that a program shut
338bb5b28e6Sdhollanddown.
339bb5b28e6SdhollandIt is sent to all processes as part of the
340bb5b28e6Sdholland.Xr shutdown 8
341bb5b28e6Sdhollandprocedure.
342bb5b28e6SdhollandThe default action is to terminate the process.
343bb5b28e6SdhollandThe number for
344bb5b28e6Sdholland.Dv SIGTERM
34551b70d09Suweis\~15.
346bb5b28e6Sdholland.\" ************
347e46faeedSwiz.It Dv SIGURG No (Urgent I/O condition)
348bb5b28e6SdhollandThis signal is generated when an ``urgent condition'' exists on a
349bb5b28e6Sdhollandsocket.
350bb5b28e6SdhollandIn practice this means when
351bb5b28e6Sdholland.Xr tcp 4
352bb5b28e6Sdhollandout-of-band data has arrived.
353bb5b28e6SdhollandThe default action is to do nothing.
354bb5b28e6SdhollandThe number for
355bb5b28e6Sdholland.Dv SIGURG
35651b70d09Suweis\~16.
357bb5b28e6Sdholland.\" ************
358e46faeedSwiz.It Dv SIGSTOP No (Suspended (signal))
359bb5b28e6SdhollandThis signal cannot be caught or ignored.
360bb5b28e6SdhollandThe (unconditional) action is to stop the process.
361bb5b28e6SdhollandNote that like with
362bb5b28e6Sdholland.Dv SIGKILL
363bb5b28e6Sdholland(and for similar reasons) it is best to not send this signal until a
364bb5b28e6Sdhollandprocess has failed to respond to
365bb5b28e6Sdholland.Dv SIGTSTP .
366bb5b28e6SdhollandIt can also be used by processes to stop themselves after catching
367bb5b28e6Sdholland.Dv SIGTSTP .
368bb5b28e6SdhollandA process that is explicitly stopped will not run again until told to
369bb5b28e6Sdhollandwith
370bb5b28e6Sdholland.Dv SIGCONT .
371bb5b28e6SdhollandThe number for
372bb5b28e6Sdholland.Dv SIGSTOP
37351b70d09Suweis\~17.
374bb5b28e6Sdholland.\" ************
375e46faeedSwiz.It Dv SIGTSTP No (Suspended)
3767f402ed8SuweThis signal is generated by the
377bb5b28e6Sdholland.Xr tty 4
3787f402ed8Suwedriver
379bb5b28e6Sdhollandwhen the user presses the stop character, normally control-Z.
380bb5b28e6SdhollandThe default action is to stop the process.
381bb5b28e6SdhollandThe number for
382bb5b28e6Sdholland.Dv SIGTSTP
38351b70d09Suweis\~18.
384bb5b28e6Sdholland.\" ************
385e46faeedSwiz.It Dv SIGCONT No (Continued)
386bb5b28e6SdhollandThis signal is generated by the job-control feature of shells to
387bb5b28e6Sdhollandmanage processes.
388bb5b28e6SdhollandIt causes the target process to start executing again after previously
389bb5b28e6Sdhollandbeing stopped.
390bb5b28e6SdhollandThis happens as a magic extra effect
391bb5b28e6Sdholland.Nm before
392bb5b28e6Sdhollandthe signal is actually delivered.
393bb5b28e6SdhollandThe default action when the signal is delivered is to do nothing (else).
394bb5b28e6SdhollandThe number for
395bb5b28e6Sdholland.Dv SIGCONT
39651b70d09Suweis\~19.
397bb5b28e6Sdholland.\" ************
398e46faeedSwiz.It Dv SIGCHLD No (Child exited, stopped or continued)
399bb5b28e6SdhollandThis signal is generated by the kernel when one of a process's
400bb5b28e6Sdhollandimmediate children exits and can be waited for using one of the
401aad76760Swiz.Xr wait 2
402bb5b28e6Sdhollandfamily of functions.
403bb5b28e6SdhollandThe default action is to do nothing.
4045aec88eaSriastradh.Pp
405*17cc3264SriastradhAs a special case, if a child exits when its parent process has
406bb5b28e6Sdholland.Dv SIGCHLD
407*17cc3264Sriastradhignored
408*17cc3264Sriastradh.Pq not merely blocked
409*17cc3264Sriastradhby having its signal handler set to
410*17cc3264Sriastradh.Dv SIG_IGN ,
411*17cc3264Sriastradhor if the signal action has the
412*17cc3264Sriastradh.Dv SA_NOCLDWAIT
413*17cc3264Sriastradhflag set
414*17cc3264Sriastradh.Pq Xr sigaction 2 ,
415*17cc3264Sriastradhthen the child is detached so that
416*17cc3264Sriastradh.Xr wait 2
417*17cc3264Sriastradhin the parent will wait for
418*17cc3264Sriastradh.Em all
419*17cc3264Sriastradhchildren to exit and then fail with
420*17cc3264Sriastradh.Er ECHILD
421*17cc3264Sriastradhwithout returning any information about any specific child processes.
4225aec88eaSriastradh.Pp
423bb5b28e6SdhollandThe number for
424bb5b28e6Sdholland.Dv SIGCHLD
42551b70d09Suweis\~20.
426bb5b28e6SdhollandThis signal was spelled
427bb5b28e6Sdholland.Dv SIGCLD
428bb5b28e6Sdhollandin old System V versions and today many systems provide both
429bb5b28e6Sdhollandspellings.
430bb5b28e6Sdholland.\" ************
431e46faeedSwiz.It Dv SIGTTIN No (Stopped (tty input))
4327f402ed8SuweThis signal is generated by the
433bb5b28e6Sdholland.Xr tty 4
4347f402ed8Suwedriver
435bb5b28e6Sdhollandwhen a process that is not in the foreground of its controlling
436bb5b28e6Sdhollandterminal attempts to read from this terminal.
437bb5b28e6SdhollandThe default action is to stop the process.
438bb5b28e6SdhollandThe number for
439bb5b28e6Sdholland.Dv SIGTTIN
44051b70d09Suweis\~21.
441bb5b28e6Sdholland.\" ************
442e46faeedSwiz.It Dv SIGTTOU No (Stopped (tty output))
4437f402ed8SuweThis signal is generated by the
444bb5b28e6Sdholland.Xr tty 4
4457f402ed8Suwedriver
446bb5b28e6Sdhollandwhen a process that is not in the foreground of its controlling
447bb5b28e6Sdhollandterminal attempts to write to this terminal, if the terminal is
448bb5b28e6Sdhollandconfigured accordingly, which is not the default.
449bb5b28e6Sdholland(See
450bb5b28e6Sdholland.Xr termios 4 . )
451bb5b28e6SdhollandThe default action is to stop the process.
452bb5b28e6SdhollandThe number for
453bb5b28e6Sdholland.Dv SIGTTOU
45451b70d09Suweis\~22.
455bb5b28e6Sdholland.\" ************
456e46faeedSwiz.It Dv SIGIO No (I/O possible)
457bb5b28e6SdhollandThis signal is sent by the kernel when I/O becomes possible on a file
458bb5b28e6Sdhollandhandle opened for asynchronous access with
459bb5b28e6Sdholland.Dv O_ASYNC .
460bb5b28e6SdhollandSee
461bb5b28e6Sdholland.Xr open 2
462bb5b28e6Sdhollandand
463bb5b28e6Sdholland.Xr fcntl 2 .
464bb5b28e6SdhollandThe default action is to do nothing.
465bb5b28e6SdhollandThe number for
466bb5b28e6Sdholland.Dv SIGIO
46751b70d09Suweis\~23.
468bb5b28e6Sdholland.\" ************
469e46faeedSwiz.It Dv SIGXCPU No (CPU time limit exceeded)
470bb5b28e6SdhollandThis signal is sent by the kernel when the amount of CPU time consumed
471bb5b28e6Sdhollandexceeds the configured limit.
472bb5b28e6SdhollandSee
473bb5b28e6Sdholland.Xr setrlimit 2
474bb5b28e6Sdhollandand the
475aad76760Swiz.Ic ulimit
476bb5b28e6Sdhollandand
477aad76760Swiz.Ic rlimit
478bb5b28e6Sdhollandbuiltins of
479bb5b28e6Sdholland.Xr sh 1
480bb5b28e6Sdhollandand
481bb5b28e6Sdholland.Xr csh 1
482bb5b28e6Sdhollandrespectively.
483bb5b28e6SdhollandThe default action is to terminate the process.
484bb5b28e6SdhollandThe number for
485bb5b28e6Sdholland.Dv SIGXCPU
48651b70d09Suweis\~24.
487bb5b28e6Sdholland.\" ************
488e46faeedSwiz.It Dv SIGXFSZ No (File size limit exceeded)
489bb5b28e6SdhollandThis signal is sent by the kernel when a write causes the size of a
490bb5b28e6Sdhollandfile to exceed the configured limit.
491bb5b28e6SdhollandSee
492bb5b28e6Sdholland.Xr setrlimit 2
493bb5b28e6Sdhollandand the
494aad76760Swiz.Ic ulimit
495bb5b28e6Sdhollandand
496aad76760Swiz.Ic rlimit
497bb5b28e6Sdhollandbuiltins of
498bb5b28e6Sdholland.Xr sh 1
499bb5b28e6Sdhollandand
500bb5b28e6Sdholland.Xr csh 1
501bb5b28e6Sdhollandrespectively.
502bb5b28e6SdhollandThe default action is to terminate the process.
503bb5b28e6SdhollandThe number for
504bb5b28e6Sdholland.Dv SIGXFSZ
50551b70d09Suweis\~25.
506bb5b28e6Sdholland.\" ************
507e46faeedSwiz.It Dv SIGVTALRM No (Virtual timer expired)
508bb5b28e6SdhollandThis signal is generated by the kernel when a virtual-time (process
509bb5b28e6Sdhollandexecution time) timer expires.
510bb5b28e6SdhollandSee
511bb5b28e6Sdholland.Xr setitimer 2
512bb5b28e6Sdhollandand
513bb5b28e6Sdholland.Xr timer_settime 2 .
514bb5b28e6SdhollandThe default action is to terminate the process.
515bb5b28e6SdhollandThe number for
516bb5b28e6Sdholland.Dv SIGVTALRM
51751b70d09Suweis\~26.
518bb5b28e6Sdholland.\" ************
519e46faeedSwiz.It Dv SIGPROF No (Profiling timer expired)
520bb5b28e6SdhollandThis signal is generated by the kernel when a profiling timer
521bb5b28e6Sdhollandexpires.
522bb5b28e6SdhollandSee
523bb5b28e6Sdholland.Xr setitimer 2
524bb5b28e6Sdhollandand
525bb5b28e6Sdholland.Xr timer_settime 2 .
526bb5b28e6SdhollandThe default action is to terminate the process.
527bb5b28e6SdhollandThe number for
528bb5b28e6Sdholland.Dv SIGPROF
52951b70d09Suweis\~27.
530bb5b28e6Sdholland.\" ************
531e46faeedSwiz.It Dv SIGWINCH No (Window size changed)
5327f402ed8SuweThis signal is generated by the
533bb5b28e6Sdholland.Xr tty 4
5347f402ed8Suwedriver
535bb5b28e6Sdhollandwhen the stored window size of the process's controlling terminal has
536bb5b28e6Sdhollandchanged.
537bb5b28e6SdhollandThe default action is to do nothing.
538bb5b28e6SdhollandThe number for
539bb5b28e6Sdholland.Dv SIGWINCH
54051b70d09Suweis\~28.
541bb5b28e6Sdholland.\" ************
542e46faeedSwiz.It Dv SIGINFO No (Information request)
5437f402ed8SuweThis signal is generated by the
544bb5b28e6Sdholland.Xr tty 4
5457f402ed8Suwedriver
546bb5b28e6Sdhollandwhen the user presses the status request character, normally
547bb5b28e6Sdhollandcontrol-T.
548bb5b28e6SdhollandThe default action is to do nothing.
549bb5b28e6SdhollandThe number for
550bb5b28e6Sdholland.Dv SIGINFO
55151b70d09Suweis\~29.
552bb5b28e6Sdholland.\" ************
553e46faeedSwiz.It Dv SIGUSR1 No (User defined signal 1)
554bb5b28e6SdhollandThis signal is not generated by the system and is made available for
555bb5b28e6Sdhollandapplications to use for their own purposes.
556bb5b28e6SdhollandMany daemons use it for restart or reload requests of various types.
557bb5b28e6SdhollandThe default action is to terminate the process.
558bb5b28e6SdhollandThe number for
559bb5b28e6Sdholland.Dv SIGUSR1
56051b70d09Suweis\~30.
561bb5b28e6Sdholland.\" ************
562e46faeedSwiz.It Dv SIGUSR2 No (User defined signal 2)
563bb5b28e6SdhollandThis signal is not generated by the system and is made available for
564bb5b28e6Sdhollandapplications to use for their own purposes.
565bb5b28e6SdhollandThe default action is to terminate the process.
566bb5b28e6SdhollandThe number for
567bb5b28e6Sdholland.Dv SIGUSR2
56851b70d09Suweis\~31.
569bb5b28e6Sdholland.\" ************
570e46faeedSwiz.It Dv SIGPWR No (Power fail/restart)
571bb5b28e6SdhollandThis signal is notionally sent by the kernel or by a privileged
572bb5b28e6Sdhollandmonitor process when an external power failure is detected, and again
573bb5b28e6Sdhollandwhen power has been restored.
574bb5b28e6SdhollandCurrently
575bb5b28e6Sdholland.Nx
576bb5b28e6Sdhollanddoes not in fact send
577bb5b28e6Sdholland.Dv SIGPWR ,
578bb5b28e6Sdhollandalthough it is possible to prepare a custom configuration for
579bb5b28e6Sdholland.Xr powerd 8
580bb5b28e6Sdhollandthat does so.
581bb5b28e6SdhollandThe default action is to do nothing.
582bb5b28e6SdhollandThe number for
583bb5b28e6Sdholland.Dv SIGPWR
58451b70d09Suweis\~32.
585bb5b28e6Sdholland.\" ************
586e46faeedSwiz.El
587bb5b28e6Sdholland.Ss Shell Interface
588bb5b28e6SdhollandSignals may be sent with the
589bb5b28e6Sdholland.Xr kill 1
590bb5b28e6Sdhollandutility, either by number or the symbolic name without the ``SIG'' part.
591bb5b28e6SdhollandThis utility is built into many shells to allow addressing job control
592bb5b28e6Sdhollandjobs.
593bb5b28e6Sdholland.Ss Program Interface
594bb5b28e6SdhollandIn C code signals may be sent using
595bb5b28e6Sdholland.Xr raise 3 ,
596bb5b28e6Sdholland.Xr kill 2 ,
597aad76760Swiz.Xr pthread_kill 3 ,
598bb5b28e6Sdhollandand some other related functions.
599bb5b28e6Sdholland.Pp
600bb5b28e6SdhollandSignals may be caught or ignored using
601bb5b28e6Sdholland.Xr sigaction 2
602bb5b28e6Sdhollandor the simpler
603bb5b28e6Sdholland.Xr signal 3 ,
604bb5b28e6Sdhollandand blocked using
605aad76760Swiz.Xr sigprocmask 2 .
606aef7e0d5Sjdolecek.Sh STANDARDS
607bb5b28e6SdhollandThe
608aef7e0d5Sjdolecek.Dv SIGTRAP ,
609aef7e0d5Sjdolecek.Dv SIGEMT ,
610aef7e0d5Sjdolecek.Dv SIGBUS ,
611aef7e0d5Sjdolecek.Dv SIGSYS ,
612aef7e0d5Sjdolecek.Dv SIGURG ,
613aef7e0d5Sjdolecek.Dv SIGIO ,
614aef7e0d5Sjdolecek.Dv SIGXCPU ,
615aef7e0d5Sjdolecek.Dv SIGXFSZ ,
616aef7e0d5Sjdolecek.Dv SIGVTALRM ,
617aef7e0d5Sjdolecek.Dv SIGPROF ,
618aef7e0d5Sjdolecek.Dv SIGWINCH ,
619aef7e0d5Sjdolecekand
620aef7e0d5Sjdolecek.Dv SIGINFO
621bb5b28e6Sdhollandsignals are long-existing Berkeley extensions, available on most
622aef7e0d5Sjdolecek.Bx Ns \-derived
623bb5b28e6Sdhollandsystems.
624bb5b28e6SdhollandThe
625aef7e0d5Sjdolecek.Dv SIGPWR
626bb5b28e6Sdhollandsignal comes from System V.
627bb5b28e6Sdholland.Pp
628bb5b28e6SdhollandThe remaining signals conform to
629bb5b28e6Sdholland.St -p1003.1-90 .
6304a80dfe1Sjhawk.Sh HISTORY
631aef7e0d5Sjdolecek.Dv SIGPWR
6324a80dfe1Sjhawkwas introduced in
6334a80dfe1Sjhawk.Nx 1.4 .
634