From 1de1835682a9a5089ea01e46ce38d96418a846ed Mon Sep 17 00:00:00 2001 From: michaels Date: Fri, 13 Dec 1996 21:24:12 +0000 Subject: [PATCH] correct function declaration and return --- lib/libc/gen/signal.3 | 33 +++++++++++++++++++++------------ 1 file 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 .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 -- 2.20.1