summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/sigaction.234
1 files changed, 28 insertions, 6 deletions
diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2
index e1458bc1a04..24435274ad0 100644
--- a/lib/libc/sys/sigaction.2
+++ b/lib/libc/sys/sigaction.2
@@ -183,6 +183,20 @@ the system will deliver the signal to the process on a
specified with
.Xr sigstack 2 .
.Pp
+Finally, the
+.Dv SA_SIGINFO
+option causes the 2nd argument for the signal handler to be a pointer
+to a
+.Em siginfo_t
+as described in
+.Pa <sys/siginfo.h> .
+The
+.Em siginfo_t
+is a part of
+.St -p1003.1b .
+and provides much more information about the causes and
+attributes of the signal that is being delivered.
+.Pp
If a signal is caught during the system calls listed below,
the call may be forced to terminate
with the error
@@ -288,8 +302,9 @@ is set to indicated the reason.
.Sh EXAMPLE
The handler routine can be declared:
.Bd -literal -offset indent
-void handler(sig, code, scp)
-int sig, code;
+void handler(sig, sip, scp)
+int sig;
+siginfo_t *sip;
struct sigcontext *scp;
.Ed
.Pp
@@ -297,10 +312,17 @@ Here
.Fa sig
is the signal number, into which the hardware faults and traps are
mapped.
-.Fa Code
-is a parameter that is either a constant
-or the code provided by
-the hardware.
+If the
+.Dv SA_SIGINFO
+option is set,
+.Fa sip
+is a pointer to a
+.Dv siginfo_t
+as described in
+.Pa <sys/siginfo.h> .
+If
+.Dv SA_SIGINFO
+is not set, this is NULL.
.Fa Scp
is a pointer to the
.Fa sigcontext