From 218d23e5a31c192a1fccb68c58247b9b2aae010b Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 27 May 2007 21:33:14 +0000 Subject: [PATCH] Rewrote various parts. --- man2/signal.2 | 59 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/man2/signal.2 b/man2/signal.2 index 0f5c5051c..19b211330 100644 --- a/man2/signal.2 +++ b/man2/signal.2 @@ -1,4 +1,5 @@ .\" Copyright (c) 2000 Andries Brouwer +.\" and Copyrigh (c) 2007 Michael Kerrisk .\" based on work by Rik Faith .\" and Mike Battersby . .\" @@ -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