-.\" $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.
.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
.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 :
.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
A
.Dv SIG_DFL
resets the default action.
-To ignore the signal
+To ignore the signal,
.Fa func
should be
.Dv SIG_IGN .
.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
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