Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys Reflect reality after siginfo changes.



details:   https://anonhg.NetBSD.org/src/rev/98df4596ece3
branches:  trunk
changeset: 551693:98df4596ece3
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Sep 10 14:13:07 2003 +0000

description:
Reflect reality after siginfo changes.

diffstat:

 lib/libc/sys/sigaction.2 |  62 +++++++++++++++++++----------------------------
 1 files changed, 25 insertions(+), 37 deletions(-)

diffs (104 lines):

diff -r a7f7cc6aff73 -r 98df4596ece3 lib/libc/sys/sigaction.2
--- a/lib/libc/sys/sigaction.2  Wed Sep 10 14:12:23 2003 +0000
+++ b/lib/libc/sys/sigaction.2  Wed Sep 10 14:13:07 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sigaction.2,v 1.35 2003/08/07 16:44:08 agc Exp $
+.\"    $NetBSD: sigaction.2,v 1.36 2003/09/10 14:13:07 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"    @(#)sigaction.2 8.2 (Berkeley) 4/3/94
 .\"
-.Dd May 11, 2003
+.Dd September 10, 2003
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -110,7 +110,8 @@
 .Em "struct sigaction"
 includes the following members:
 .Bd -literal -offset indent
-void      (*sa_handler)(int)
+void     (*sa_sigaction)(int sig, siginfo_t *info, void *ctx)
+void      (*sa_handler)(int sig)
 sigset_t  sa_mask
 int       sa_flags
 .Ed
@@ -199,6 +200,26 @@
 the system will not create a zombie when the child exits, but the child
 process will be automatically waited for.
 .Pp
+A user can receive additional information about a caught signal by
+setting the
+.Dv SA_SIGINFO
+flag. An alternative handler that gets passed additional arguments will
+be called which is named
+.Fa sa_sigaction .
+The
+.Ar sig
+argument of this handler contains the signal number that was caught. The
+.Ar info
+argument contains additional signal specific information which
+is listed in
+.Xr siginfo 5 .
+The
+.Ar ctx
+argument 
+is a pointer to the
+.Xr ucontext 5
+context where the signal handler will return to.
+.Pp
 If a signal is caught during the system calls listed below,
 the call may be forced to terminate
 with the error
@@ -260,40 +281,6 @@
 A \-1 return value indicates an error occurred and
 .Va errno
 is set to indicate the reason.
-.Sh EXAMPLES
-The handler routine can be declared:
-.Bd -literal -offset indent
-void
-handler(sig, code, scp)
-       int sig, code;
-       struct sigcontext *scp;
-.Ed
-.Pp
-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.
-.Fa scp
-is a pointer to the
-.Fa sigcontext
-structure (defined in
-.Aq Pa signal.h ) ,
-used to restore the context from before the signal.
-.Pp
-For POSIX compliance, the
-.Fa sa_handler
-is declared to be (void (*)(int)) and the above handler will need to be
-casted to that type.
-Future versions of
-.Nx
-will replace the
-.Fa sigcontext
-interface with the
-.Fa siginfo
-interface.
 .Sh ERRORS
 .Fn sigaction
 will fail and no new signal handler will be installed if one
@@ -336,6 +323,7 @@
 .Xr sigsuspend 2 ,
 .Xr setjmp 3 ,
 .Xr sigsetops 3 ,
+.Xr siginfo 5 ,
 .Xr tty 4 ,
 .Xr signal 7
 .Sh STANDARDS



Home | Main Index | Thread Index | Old Index