summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/signal.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/signal.3')
-rw-r--r--lib/libc/gen/signal.324
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/libc/gen/signal.3 b/lib/libc/gen/signal.3
index e17c2df..192e2d8 100644
--- a/lib/libc/gen/signal.3
+++ b/lib/libc/gen/signal.3
@@ -39,12 +39,13 @@
.Nd simplified software signal facilities
.Sh SYNOPSIS
.Fd #include <signal.h>
-.Ft void
-.Fn *signal sig func\*(lp\*(rp
-.Ft void
-.\" can not do this with .Fn yet
-.br
-\*(lp\|\*(fN*func\*(rp\*(lp\|\*(rp\fR
+.Ft void \*(lp*
+.Fn signal "int sig" "void \*(lp*func\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint"
+
+or in FreeBSD's equivalent but easier to read typedef'd version:
+.Ft typedef "void \*(lp*sig_t\*(rp \*(lpint\*(rp"
+.Ft sig_t
+.Fn signal "int sig" "sig_t func"
.Sh DESCRIPTION
This
.Fn signal
@@ -97,7 +98,7 @@ call (formerly
.It Dv SIGKILL No " terminate process" " kill program"
.It Dv SIGBUS No " create core image" " bus error"
.It Dv SIGSEGV No " create core image" " segmentation violation"
-.It Dv SIGSYS No " create core image" " system call given invalid argument"
+.It Dv SIGSYS No " create core image" " non-existent system call invoked"
.It Dv SIGPIPE No " terminate process" " write on a pipe with no reader"
.It Dv SIGALRM No " terminate process" " real-time timer expired"
.It Dv SIGTERM No " terminate process" " software termination signal"
@@ -126,6 +127,9 @@ is possible on a descriptor (see
.El
.Pp
The
+.Fa sig
+parameter specifies which signal was received.
+The
.Fa func
procedure allows a user to choose the action upon receipt of a signal.
To set the default action of the signal to occur as listed above,
@@ -148,7 +152,7 @@ automatically blocked and
.Fa func
is called.
.Pp
-The handled signal is unblocked with the
+The handled signal is unblocked when the
function returns and
the process continues from where it left off when the signal occurred.
.Bf -symbolic
@@ -192,7 +196,7 @@ Otherwise, \-1 is returned and the global variable
.Va errno
is set to indicate the error.
.Sh ERRORS
-.Xr Signal
+.Fn Signal
will fail and no action will take place if one of the
following occur:
.Bl -tag -width [EINVAL]
@@ -206,8 +210,8 @@ or
.Ev SIGSTOP .
.Sh SEE ALSO
.Xr kill 1 ,
-.Xr ptrace 2 ,
.Xr kill 2 ,
+.Xr ptrace 2 ,
.Xr sigaction 2 ,
.Xr sigaltstack 2 ,
.Xr sigprocmask 2 ,
OpenPOWER on IntegriCloud