From 56f3b63beab96eb4dfd6591f6dff00aa76035e6b Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 8 Oct 2017 10:49:36 +0200 Subject: [PATCH] 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 --- man2/sigaction.2 | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/man2/sigaction.2 b/man2/sigaction.2 index 513a94038..62c158e18 100644 --- a/man2/sigaction.2 +++ b/man2/sigaction.2 @@ -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: