Rewrote various parts.

This commit is contained in:
Michael Kerrisk 2007-05-27 21:33:14 +00:00
parent bc0d5df316
commit 218d23e5a3
1 changed files with 36 additions and 23 deletions

View File

@ -1,4 +1,5 @@
.\" Copyright (c) 2000 Andries Brouwer <aeb@cwi.nl>
.\" and Copyrigh (c) 2007 Michael Kerrisk <mtk-manpages@gmx.net>
.\" based on work by Rik Faith <faith@cs.unc.edu>
.\" and Mike Battersby <mike@starbug.apana.org.au>.
.\"
@ -24,7 +25,8 @@
.\"
.\" Modified 2004-11-19, mtk:
.\" added pointer to sigaction.2 for details of ignoring SIGCHLD
.\" 2007-06-03, mtk: strengthened portability warning.
.\" 2007-06-03, mtk: strengthened portability warning, and rerote
.\" various sections.
.\"
.TH SIGNAL 2 2007-06-03 "Linux" "Linux Programmer's Manual"
.SH NAME
@ -45,39 +47,43 @@ and has also varied historically across different versions of Linux.
instead.
See \fIPortability\fP below.
The
.BR signal ()
system call installs a new signal handler for the signal with number
.IR signum .
The signal handler is set to
.I handler
which may be a user specified function, or either
.B SIG_IGN
or
.BR SIG_DFL .
sets the disposition of the signal
.IR signum
to
.IR handler ,
which is either
.BR SIG_IGN ,
.BR SIG_DFL ,
or the address of a programmer-defined function (a "signal handler"),
Upon arrival of a signal with number
If the signal
.I signum
the following happens.
If the corresponding handler is set to
is delivered to the process, then one of the following happens:
.TP 3
*
If the disposition is set to
.BR SIG_IGN ,
then the signal is ignored.
If the handler is set to
.TP
*
If the disposition is set to
.BR SIG_DFL ,
then the default action associated with the signal (see
.BR signal (7))
occurs.
Finally, if the handler is set to a function
.I handler
then first either the handler is reset to SIG_DFL
or an implementation-dependent blocking of the signal
is performed, and then
.TP
*
If the disposition is set to a function,
then first either the disposition is reset to
.BR SIG_DFL ,
or the signal is blocked (see \fIPortability\fP below), and then
.I handler
is called with argument
.IR signum .
Using a signal handler function for a signal
is called "catching the signal".
If invokation of the handler caused the signal to be blocked,
then the signal is unblocked upon return from the handler.
.PP
The signals
.B SIGKILL
and
@ -88,10 +94,17 @@ cannot be caught or ignored.
returns the previous value of the signal handler, or
.B SIG_ERR
on error.
.SH ERRORS
.TP
.B EINVAL
.I signum
is invalid.
.SH "CONFORMING TO"
C89, C99, POSIX.1-2001.
.SH NOTES
The effects of this call in a multi-threaded process are unspecified.
The effects of
.BR signal ()
in a multi-threaded process are unspecified.
.PP
According to POSIX, the behaviour of a process is undefined after it
ignores a