summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authormichaels <michaels@cvs.openbsd.org>1996-12-13 21:24:13 +0000
committermichaels <michaels@cvs.openbsd.org>1996-12-13 21:24:13 +0000
commitfdd59074e3fbf2fba681b9eb315901e2476318c8 (patch)
treeec71504244953884254db2f42c83eda5ea6d31ae /lib/libc
parentab3aafcb19ac4c40ddda443dafe46675cd333304 (diff)
correct function declaration and return
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/signal.333
1 files changed, 21 insertions, 12 deletions
diff --git a/lib/libc/gen/signal.3 b/lib/libc/gen/signal.3
index be8dac64bb7..390c92e2bb4 100644
--- a/lib/libc/gen/signal.3
+++ b/lib/libc/gen/signal.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: signal.3,v 1.3 1996/08/19 08:26:07 tholo Exp $
+.\" $OpenBSD: signal.3,v 1.4 1996/12/13 21:24:12 michaels Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -41,12 +41,12 @@
.Fd #include <signal.h>
.Ft void
.\" can not do this with just .Fn yet
-.br
-.Po
-.Fn *signal "int sig" "void (*func)()"
-.Pc Ns \*(lp\*(rp
+.\" .br
+.\" .Po
+.Fn (*signal "int sigcatch" "void (*func)(int sigraised))) (int"
+.\" .Pc Ns \*(lp\*(rp
.Sh DESCRIPTION
-This
+The
.Fn signal
facility
is a simplified interface to the more general
@@ -78,7 +78,7 @@ and
.Dv SIGSTOP
signals, the
.Fn signal
-function allows for a signal to be caught, to be ignored, or to generate
+function allows for any signal to be caught, to be ignored, or to generate
an interrupt.
These signals are defined in the file
.Aq Pa signal.h :
@@ -127,7 +127,13 @@ is possible on a descriptor (see
.Pp
The
.Fa func
-procedure allows a user to choose the action upon receipt of a signal.
+function allows a user to choose the action upon receipt of the signal,
+.Fa sigcatch .
+The function will be called with one argument,
+.Fa sigraised ,
+which is the signal raised. (thus the same function,
+.Fa func ,
+can be used by more than one signal.)
To set the default action of the signal to occur as listed above,
.Fa func
should be
@@ -135,7 +141,7 @@ should be
A
.Dv SIG_DFL
resets the default action.
-To ignore the signal
+To ignore the signal,
.Fa func
should be
.Dv SIG_IGN .
@@ -148,8 +154,9 @@ automatically blocked and
.Fa func
is called.
.Pp
-The handled signal is unblocked with the
-function returns and
+The handled signal is unblocked when
+.Fa func
+returns and
the process continues from where it left off when the signal occurred.
.Bf -symbolic
Unlike previous signal facilities, the handler
@@ -188,7 +195,9 @@ function;
ignored signals remain ignored.
.Sh RETURN VALUES
The previous action is returned on a successful call.
-Otherwise, \-1 is returned and the global variable
+Otherwise,
+.Fa SIG_ERR
+is returned and the global variable
.Va errno
is set to indicate the error.
.Sh ERRORS