Print this page
Minor markup tweaks (Sy instead of Nm).
fix incorrect standard citations
first round of POSIX 2008 stuff

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3c/bsd_signal.3c
          +++ new/usr/src/man/man3c/bsd_signal.3c
   1      -'\" te
   2    1  .\"  Copyright (c) 1992, X/Open Company Limited All Rights Reserved  Portions Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
   3    2  .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   4    3  .\" http://www.opengroup.org/bookstore/.
   5    4  .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   6    5  .\"  This notice shall appear on any product containing this material.
   7    6  .\" 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.
   8    7  .\" 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.
   9    8  .\" 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]
  10      -.TH BSD_SIGNAL 3C "Jul 24, 2002"
  11      -.SH NAME
  12      -bsd_signal \- simplified signal facilities
  13      -.SH SYNOPSIS
  14      -.LP
  15      -.nf
  16      -#include <signal.h>
  17      -
  18      -\fBvoid\fR (\fB*bsd_signal(int\fR \fIsig\fR, \fBvoid\fR (*\fIfunc\fR)(\fBint\fR)))(\fBint\fR);
  19      -.fi
  20      -
  21      -.SH DESCRIPTION
  22      -.sp
  23      -.LP
  24      -The \fBbsd_signal()\fR function provides a partially compatible interface for
  25      -programs written to historical system interfaces (see \fBUSAGE\fR below).
  26      -.sp
  27      -.LP
  28      -The function call \fBbsd_signal\fR(\fIsig\fR, \fIfunc\fR) has an effect as if
  29      -implemented as:
  30      -.sp
  31      -.in +2
  32      -.nf
        9 +.Dd "Jul 19, 2014"
       10 +.Dt BSD_SIGNAL 3C
       11 +.Os
       12 +.Sh NAME
       13 +.Nm bsd_signal
       14 +.Nd simplified signal facilities
       15 +.Sh SYNOPSIS
       16 +.In signal.h
       17 +.Ft void
       18 +.Fn \*(lp*bsd_signal "int sig" "void \*(lp*func\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint"
       19 +.\" \fBvoid\fR (\fB*bsd_signal(int\fR \fIsig\fR, \fBvoid\fR (*\fIfunc\fR)(\fBint\fR)))(\fBint\fR);
       20 +.Sh DESCRIPTION
       21 +The
       22 +.Fn bsd_signal
       23 +function provides a partially compatible interface for
       24 +programs written to historical system interfaces (see
       25 +.Sx USAGE
       26 +below).
       27 +.Lp
       28 +The function call
       29 +.Fn bsd_signal sig func
       30 +has an effect as if implemented as:
       31 +.Bd -literal -offset indent
  33   32  void (*bsd_signal(int sig, void (*func)\|(int)))\|(int)
  34   33  {
  35   34       struct sigaction act, oact;
  36   35  
  37      -     act.sa_handler = \fIfunc\fR;
       36 +     act.sa_handler = func;
  38   37       act.sa_flags = SA_RESTART;
  39   38       sigemptyset(&act.sa_mask);
  40      -     sigaddset(&act.sa_mask, \fIsig\fR);
  41      -     if (sigaction(\fIsig\fR, &act, &oact) == \(mi1)
  42      -          return(\fBSIG_ERR\fR);
       39 +     sigaddset(&act.sa_mask, sig);
       40 +     if (sigaction(sig, &act, &oact) == \(mi1)
       41 +          return(SIG_ERR);
  43   42       return(oact.sa_handler);
  44   43  }
  45      -.fi
  46      -.in -2
  47      -
  48      -.sp
  49      -.LP
       44 +.Ed
       45 +.Lp
  50   46  The handler function should be declared:
  51      -.sp
  52      -.in +2
  53      -.nf
  54      -void handler(int \fIsig\fR);
  55      -.fi
  56      -.in -2
  57      -
  58      -.sp
  59      -.LP
  60      -where \fIsig\fR is the signal number.  The behavior is undefined if \fIfunc\fR
       47 +.Lp
       48 +.Dl Ft void Fn handler "int sig" ;
       49 +.Lp
       50 +where
       51 +.Fa sig
       52 +is the signal number.  The behavior is undefined if
       53 +.Fa func
  61   54  is a function that takes more than one argument, or an argument of a different
  62   55  type.
  63      -.SH RETURN VALUES
  64      -.sp
  65      -.LP
  66      -Upon successful completion, \fBbsd_signal()\fR returns the previous action for
  67      -\fIsig\fR. Otherwise, \fBSIG_ERR\fR is returned and \fBerrno\fR is set to
  68      -indicate the error.
  69      -.SH ERRORS
  70      -.sp
  71      -.LP
  72      -Refer to \fBsigaction\fR(2).
  73      -.SH USAGE
  74      -.sp
  75      -.LP
  76      -This function is a direct replacement for the \fBBSD\fR \fBsignal\fR(3UCB)
       56 +.Sh RETURN VALUES
       57 +Upon successful completion,
       58 +.Fn bsd_signal
       59 +returns the previous action for
       60 +.Fa sig .
       61 +Otherwise,
       62 +.Dv SIG_ERR
       63 +is returned and
       64 +.Va errno
       65 +is set to indicate the error.
       66 +.Sh ERRORS
       67 +Refer to
       68 +.Xr sigaction 2 .
       69 +.Sh USAGE
       70 +This function is a direct replacement for the
       71 +.Bx
       72 +.Fn signal
  77   73  function for simple applications that are installing a single-argument signal
  78      -handler function.  If a \fBBSD\fR signal handler function is being installed
       74 +handler function.  If a
       75 +.Bx
       76 +signal handler function is being installed
  79   77  that expects more than one argument, the application has to be modified to use
  80      -\fBsigaction\fR(2). The \fBbsd_signal()\fR function differs from
  81      -\fBsignal\fR(3UCB) in that the \fBSA_RESTART\fR flag is set and the
  82      -\fBSA_RESETHAND\fR will be clear when \fBbsd_signal()\fR is used.  The state of
  83      -these flags is not specified for \fBsignal\fR(3UCB).
  84      -.SH ATTRIBUTES
  85      -.sp
  86      -.LP
  87      -See \fBattributes\fR(5) for descriptions of the following attributes:
  88      -.sp
  89      -
  90      -.sp
  91      -.TS
  92      -box;
  93      -c | c
  94      -l | l .
  95      -ATTRIBUTE TYPE  ATTRIBUTE VALUE
  96      -_
  97      -Interface Stability     Standard
  98      -.TE
  99      -
 100      -.SH SEE ALSO
 101      -.sp
 102      -.LP
 103      -\fBsigaction\fR(2), \fBsigaddset\fR(3C), \fBsigemptyset\fR(3C),
 104      -\fBsignal\fR(3UCB), \fBattributes\fR(5), \fBstandards\fR(5)
       78 +.Xr sigaction 2 .
       79 +.Lp
       80 +Portable applications should use
       81 +.Xr sigaction 2
       82 +instead of this function.
       83 +.Sh INTERFACE STABILITY
       84 +.Sy Obsolete Standard .
       85 +.Sh SEE ALSO
       86 +.Xr sigaction 2 ,
       87 +.Xr sigaddset 3C ,
       88 +.Xr sigemptyset 3C ,
       89 +.Xr standards 5
       90 +.Sh STANDARDS
       91 +The
       92 +.Fn bsd_signal
       93 +function was added in
       94 +.St -xpg4.2 .
       95 +It was subsequently obsoleted in
       96 +.St -p1003.1-2001
       97 +and removed from
       98 +.St -p1003.1-2008 .
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX