mirror of https://github.com/mkerrisk/man-pages
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:
parent
dea3ec0c24
commit
56f3b63bea
|
@ -145,17 +145,7 @@ then
|
||||||
.IR sa_handler )
|
.IR sa_handler )
|
||||||
specifies the signal-handling function for
|
specifies the signal-handling function for
|
||||||
.IR signum .
|
.IR signum .
|
||||||
This function receives the signal number as its first argument, a
|
This function receives three arguments, as described below.
|
||||||
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 .)
|
|
||||||
.PP
|
.PP
|
||||||
.I sa_mask
|
.I sa_mask
|
||||||
specifies a mask of signals which should be blocked
|
specifies a mask of signals which should be blocked
|
||||||
|
@ -282,6 +272,31 @@ handler(int sig, siginfo_t *info, void *ucontext)
|
||||||
.EE
|
.EE
|
||||||
.in
|
.in
|
||||||
.PP
|
.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
|
The
|
||||||
.I siginfo_t
|
.I siginfo_t
|
||||||
data type is a structure with the following fields:
|
data type is a structure with the following fields:
|
||||||
|
|
Loading…
Reference in New Issue