Print this page
5281 incorrect realtime signal delivery

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man2/sigaction.2
          +++ new/usr/src/man/man2/sigaction.2
   1    1  '\" te
        2 +.\" Copyright (c) 2014, Ryan Zezeski.  All Rights Reserved.
   2    3  .\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved.
   3    4  .\" Copyright 1989 AT&T
   4    5  .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5    6  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6    7  .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7      -.TH SIGACTION 2 "Mar 23, 2005"
        8 +.TH SIGACTION 2 "Oct 22, 2014"
   8    9  .SH NAME
   9   10  sigaction \- detailed signal management
  10   11  .SH SYNOPSIS
  11   12  .LP
  12   13  .nf
  13   14  #include <signal.h>
  14   15  
  15   16  \fBint\fR \fBsigaction\fR(\fBint\fR \fIsig\fR, \fBconst struct sigaction *restrict\fR \fIact\fR,
  16   17       \fBstruct sigaction *restrict\fR \fIoact\fR);
  17   18  .fi
  18   19  
  19   20  .SH DESCRIPTION
  20      -.sp
  21   21  .LP
  22   22  The \fBsigaction()\fR function allows the calling process to examine or specify
  23   23  the action to be taken on delivery of a specific signal. See
  24   24  \fBsignal.h\fR(3HEAD) for an explanation of general signal concepts.
  25   25  .sp
  26   26  .LP
  27   27  The \fIsig\fR argument specifies the signal and can be assigned any of the
  28   28  signals specified in \fBsignal.h\fR(3HEAD) except  \fBSIGKILL\fR and
  29   29  \fBSIGSTOP\fR.
  30   30  .sp
↓ open down ↓ 66 lines elided ↑ open up ↑
  97   97  (\fBSIGILL\fR, \fBSIGTRAP\fR, and \fBSIGPWR\fR cannot be  automatically reset
  98   98  when delivered; the system silently enforces this restriction).
  99   99  .RE
 100  100  
 101  101  .sp
 102  102  .ne 2
 103  103  .na
 104  104  \fB\fBSA_NODEFER\fR\fR
 105  105  .ad
 106  106  .RS 16n
 107      -If set and the signal is caught, the signal will not be automatically blocked
 108      -by the kernel while it is being caught.
      107 +If set and the signal is caught, the signal will not be automatically
      108 +blocked by the kernel while it is being caught.  Unless the signal is
      109 +a realtime signal.  Multiple instances of the same realtime signal
      110 +must be delivered in FIFO order and thus are always deferred.
 109  111  .RE
 110  112  
 111  113  .sp
 112  114  .ne 2
 113  115  .na
 114  116  \fB\fBSA_RESTART\fR\fR
 115  117  .ad
 116  118  .RS 16n
 117  119  If set and the signal is caught, functions that are interrupted by the
 118  120  execution of this signal's handler are transparently restarted by the system,
↓ open down ↓ 41 lines elided ↑ open up ↑
 160  162  .ne 2
 161  163  .na
 162  164  \fB\fBSA_NOCLDSTOP\fR\fR
 163  165  .ad
 164  166  .RS 16n
 165  167  If set and \fIsig\fR equals \fBSIGCHLD\fR, \fBSIGCHLD\fR will not be sent to
 166  168  the calling process when its child processes stop or continue.
 167  169  .RE
 168  170  
 169  171  .SH RETURN VALUES
 170      -.sp
 171  172  .LP
 172  173  Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
 173  174  returned, \fBerrno\fR is set to indicate the error, and no new signal handler
 174  175  is installed.
 175  176  .SH ERRORS
 176      -.sp
 177  177  .LP
 178  178  The \fBsigaction()\fR function will fail if:
 179  179  .sp
 180  180  .ne 2
 181  181  .na
 182  182  \fB\fBEINVAL\fR\fR
 183  183  .ad
 184  184  .RS 10n
 185  185  The value of the \fIsig\fR argument is not a valid signal number or is equal to
 186  186  \fBSIGKILL\fR or \fBSIGSTOP\fR. In addition, if in a multithreaded process, it
 187  187  is equal to \fBSIGWAITING\fR, \fBSIGCANCEL\fR, or \fBSIGLWP\fR.
 188  188  .RE
 189  189  
 190  190  .SH ATTRIBUTES
 191      -.sp
 192  191  .LP
 193  192  See \fBattributes\fR(5) for descriptions of the following attributes:
 194  193  .sp
 195  194  
 196  195  .sp
 197  196  .TS
 198  197  box;
 199  198  c | c
 200  199  l | l .
 201  200  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 202  201  _
 203  202  Interface Stability     Committed
 204  203  _
 205  204  MT-Level        Async-Signal-Safe
 206  205  _
 207  206  Standard        See \fBstandards\fR(5).
 208  207  .TE
 209  208  
 210  209  .SH SEE ALSO
 211      -.sp
 212  210  .LP
 213  211  \fBkill\fR(1), \fBIntro\fR(2), \fBexit\fR(2), \fBfcntl\fR(2), \fBgetmsg\fR(2),
 214  212  \fBioctl\fR(2), \fBkill\fR(2), \fBpause\fR(2), \fBputmsg\fR(2), \fBread\fR(2),
 215  213  \fBsigaltstack\fR(2), \fBsigprocmask\fR(2), \fBsigsend\fR(2),
 216  214  \fBsigsuspend\fR(2), \fBwaitid\fR(2), \fBwrite\fR(2), \fBrecv\fR(3SOCKET),
 217  215  \fBsend\fR(3SOCKET), \fBsiginfo.h\fR(3HEAD), \fBsignal\fR(3C),
 218  216  \fBsignal.h\fR(3HEAD), \fBsigsetops\fR(3C), \fBucontext.h\fR(3HEAD),
 219  217  \fBwait\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
 220  218  .SH NOTES
 221      -.sp
 222  219  .LP
 223  220  The handler routine can be declared:
 224  221  .sp
 225  222  .in +2
 226  223  .nf
 227  224  void handler (int \fIsig\fR, siginfo_t *\fIsip\fR, ucontext_t *\fIucp\fR);
 228  225  .fi
 229  226  .in -2
 230  227  
 231  228  .sp
 232  229  .LP
 233  230  The \fIsig\fR argument is the signal number. The \fIsip\fR argument is a
 234  231  pointer (to space on the stack) to a \fBsiginfo_t\fR structure, which provides
 235  232  additional detail about the delivery of the signal. The \fIucp\fR argument is a
 236  233  pointer (again to space on the stack) to a \fBucontext_t\fR structure (defined
 237  234  in <\fBsys/ucontext.h\fR>) which contains the context from before the signal.
 238  235  It is not recommended that \fIucp\fR be used by the handler to restore the
 239  236  context from before the signal delivery.
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX