Print this page
OS-5370 panic in signalfd (fix mancheck)
OS-5370 panic in signalfd
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3c/signalfd.3c
          +++ new/usr/src/man/man3c/signalfd.3c
   1    1  .\"
   2    2  .\"  This file and its contents are supplied under the terms of the
   3    3  .\"  Common Development and Distribution License ("CDDL"), version 1.0.
   4    4  .\"  You may only use this file in accordance with the terms of version
   5    5  .\"  1.0 of the CDDL.
   6    6  .\" 
   7    7  .\"  A full copy of the text of the CDDL should have accompanied this
   8    8  .\"  source.  A copy of the CDDL is also available via the Internet at
   9    9  .\"  http://www.illumos.org/license/CDDL.
  10   10  .\"
  11      -.\"  Copyright 2015, Joyent, Inc.
       11 +.\"  Copyright 2016, Joyent, Inc.
  12   12  .\"
  13      -.Dd "April 9, 2016"
       13 +.Dd "May 05, 2016"
  14   14  .Dt SIGNALFD 3C
  15   15  .Os
  16   16  .Sh NAME
  17   17  .Nm signalfd
  18   18  .Nd create or modify a file descriptor for signal handling
  19   19  .Sh SYNOPSIS
  20   20  .In sys/signalfd.h
  21   21  .
  22   22  .Ft int
  23   23  .Fo signalfd
↓ open down ↓ 119 lines elided ↑ open up ↑
 143  143          uint32_t ssi_trapno;    /* trap number that caused signal */
 144  144          int32_t  ssi_status;    /* exit status or signal (SIGCHLD) */
 145  145          int32_t  ssi_int;       /* unused */
 146  146          uint64_t ssi_ptr;       /* unused */
 147  147          uint64_t ssi_utime;     /* user CPU time consumed (SIGCHLD) */
 148  148          uint64_t ssi_stime;     /* system CPU time consumed (SIGCHLD) */
 149  149          uint64_t ssi_addr;      /* address that generated signal */
 150  150          uint8_t  ssi_pad[48];   /* pad size to 128 bytes */
 151  151  } signalfd_siginfo_t;
 152  152  .Ed
      153 +.Sh NOTES
      154 +File descriptor duplication during fork presents a challenge to the
      155 +.Sy signalfd
      156 +facility since signal data and events are dependent on the process from which
      157 +they are queried.  Its use with caching event systems such as
      158 +.Xr epoll 5 ,
      159 +.Sy /dev/poll ,
      160 +or
      161 +.Xr port_create 3C
      162 +can result in undefined behavior if signalfd and polling descriptors are used
      163 +together after being shared across a fork.  Such restrictions do not apply if
      164 +the child only calls
      165 +.Xr close 2
      166 +on the descriptors.
 153  167  .Sh RETURN VALUES
 154  168  Upon successful completion, a file descriptor associated with the instance
 155  169  is returned. Otherwise, -1 is returned and errno is set to indicate the error.
 156  170  When
 157  171  .Va fd
 158  172  is not -1 and there is no error, the value of
 159  173  .Va fd
 160  174  is returned.
 161  175  .Sh ERRORS
 162  176  The
↓ open down ↓ 17 lines elided ↑ open up ↑
 180  194  .It Er EMFILE
 181  195  There are currently
 182  196  .Va  OPEN_MAX
 183  197  file descriptors open in the calling process.
 184  198  .It Er ENODEV
 185  199  Unable to allocate state for the file descriptor.
 186  200  .El
 187  201  .Sh SEE ALSO
 188  202  .Xr poll 2 ,
 189  203  .Xr sigwait 2 ,
      204 +.Xr port_create 3C ,
 190  205  .Xr sigsetops 3C ,
 191  206  .Xr sigwaitinfo 3C ,
 192      -.Xr signal.h 3HEAD
      207 +.Xr signal.h 3HEAD ,
      208 +.Xr epoll 5
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX