sigaction.2: Rework discussion of SA_SIGINFO handler arguments

Expand and rework the text a little, in particular adding
a reference to sigreturn(2) as a source of further
information about the ucontext argument.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-10-08 10:49:36 +02:00
parent dea3ec0c24
commit 56f3b63bea
1 changed files with 26 additions and 11 deletions

View File

@ -145,17 +145,7 @@ then
.IR sa_handler )
specifies the signal-handling function for
.IR signum .
This function receives the signal number as its first argument, a
pointer to a
.I siginfo_t
as its second argument and a pointer to a
.I ucontext_t
(cast to \fIvoid\ *\fP) as its third argument.
(Commonly, the handler function doesn't make any use of the third argument.
See
.BR getcontext (3)
for further information about
.IR ucontext_t .)
This function receives three arguments, as described below.
.PP
.I sa_mask
specifies a mask of signals which should be blocked
@ -282,6 +272,31 @@ handler(int sig, siginfo_t *info, void *ucontext)
.EE
.in
.PP
These three arguments are as follows
.TP
.I sig
The number of the signal that caused invocation of the handler.
.TP
.I info
A pointer to a
.IR siginfo_t ,
which is a structure containing further information about the signal,
as described below.
.TP
.I ucontext
This is a pointer to a
.I ucontext_t
structure, cast to \fIvoid\ *\fP.
The structure pointed to by this field contains
signal context information that was saved
on the user-space stack by the kernel; for details, see
.BR sigreturn (2).
Further information about the
.IR ucontext_t
structure can be found in
.BR getcontext (3).
Commonly, the handler function doesn't make any use of the third argument.
.PP
The
.I siginfo_t
data type is a structure with the following fields: