Deleted Added
full compact
sigaction.2 (81352) sigaction.2 (81622)
1.\" Copyright (c) 1980, 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94
1.\" Copyright (c) 1980, 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94
33.\" $FreeBSD: head/lib/libc/sys/sigaction.2 81352 2001-08-09 13:32:13Z yar $
33.\" $FreeBSD: head/lib/libc/sys/sigaction.2 81622 2001-08-14 10:01:54Z ru $
34.\"
35.Dd April 3, 1994
36.Dt SIGACTION 2
37.Os
38.Sh NAME
39.Nm sigaction
40.Nd software signal facilities
41.Sh LIBRARY

--- 425 unchanged lines hidden (view full) ---

467SA_SIGINFO bit is set in flags.
468It then should be pointed to by the
469.Dv sa_sigaction
470member of
471.Dv struct sigaction .
472Note that you should not assign SIG_DFL or SIG_IGN this way.
473.Pp
474If the SA_SIGINFO flag is not set, the handler function should match
34.\"
35.Dd April 3, 1994
36.Dt SIGACTION 2
37.Os
38.Sh NAME
39.Nm sigaction
40.Nd software signal facilities
41.Sh LIBRARY

--- 425 unchanged lines hidden (view full) ---

467SA_SIGINFO bit is set in flags.
468It then should be pointed to by the
469.Dv sa_sigaction
470member of
471.Dv struct sigaction .
472Note that you should not assign SIG_DFL or SIG_IGN this way.
473.Pp
474If the SA_SIGINFO flag is not set, the handler function should match
475either the ANSI C or traditional BSD prototype and be pointed to by
475either the ANSI C or traditional
476.Bx
477prototype and be pointed to by
476the
477.Dv sa_handler
478member of
479.Dv struct sigaction .
480In pratice,
481.Fx
482always sends the three arguments of the latter and since the ANSI C
483prototype is a subset, both will work.
484The
485.Dv sa_handler
486member declaration in
487.Fx
488include files is that of ANSI C (as required by POSIX),
478the
479.Dv sa_handler
480member of
481.Dv struct sigaction .
482In pratice,
483.Fx
484always sends the three arguments of the latter and since the ANSI C
485prototype is a subset, both will work.
486The
487.Dv sa_handler
488member declaration in
489.Fx
490include files is that of ANSI C (as required by POSIX),
489so a function pointer of a BSD-style function needs to be casted to
491so a function pointer of a
492.Bx Ns -style
493function needs to be casted to
490compile without warning.
494compile without warning.
491The traditional BSD style is not portable and since its capabilities
495The traditional
496.Bx
497style is not portable and since its capabilities
492are a full subset of a SA_SIGINFO handler,
493its use is deprecated.
494.Pp
495The
496.Fa sig
497argument is the signal number, one of the
498.Dv SIG...
499values from <signal.h>.
500.Pp
501The
502.Fa code
498are a full subset of a SA_SIGINFO handler,
499its use is deprecated.
500.Pp
501The
502.Fa sig
503argument is the signal number, one of the
504.Dv SIG...
505values from <signal.h>.
506.Pp
507The
508.Fa code
503argument of the BSD-style handler and the
509argument of the
510.Bx Ns -style
511handler and the
504.Dv si_code
505member of the
506.Dv info
507argument to a SA_SIGINFO handler contain a numeric code explaning the
508cause of the signal, usually one of the
509.Dv SI_...
510values from
511<sys/signal.h> or codes specific to a signal, i.e. one of the
512.Dv FPE_...
513values for SIGFPE.
514.Pp
515The
516.Fa scp
512.Dv si_code
513member of the
514.Dv info
515argument to a SA_SIGINFO handler contain a numeric code explaning the
516cause of the signal, usually one of the
517.Dv SI_...
518values from
519<sys/signal.h> or codes specific to a signal, i.e. one of the
520.Dv FPE_...
521values for SIGFPE.
522.Pp
523The
524.Fa scp
517argument to a BSD-style handler points to an instance of struct
525argument to a
526.Bx Ns -style
527handler points to an instance of struct
518sigcontext.
519.Pp
520The
521.Fa context
522argument to a POSIX SA_SIGINFO handler points to an instance of
523ucontext_t.
524.Sh ERRORS
525.Fn Sigaction

--- 36 unchanged lines hidden (view full) ---

562.Dv SIGXCPU ,
563.Dv SIGXFSZ ,
564.Dv SIGVTALRM ,
565.Dv SIGPROF ,
566.Dv SIGWINCH ,
567and
568.Dv SIGINFO .
569Those signals are available on most
528sigcontext.
529.Pp
530The
531.Fa context
532argument to a POSIX SA_SIGINFO handler points to an instance of
533ucontext_t.
534.Sh ERRORS
535.Fn Sigaction

--- 36 unchanged lines hidden (view full) ---

572.Dv SIGXCPU ,
573.Dv SIGXFSZ ,
574.Dv SIGVTALRM ,
575.Dv SIGPROF ,
576.Dv SIGWINCH ,
577and
578.Dv SIGINFO .
579Those signals are available on most
570.Tn BSD Ns \-derived
580.Bx Ns \-derived
571systems.
572The
573.Dv SA_NODEFER
574and
575.Dv SA_RESETHAND
576flags are intended for backwards compatibility with other operating
577systems. The
578.Dv SA_NOCLDSTOP ,

--- 23 unchanged lines hidden ---
581systems.
582The
583.Dv SA_NODEFER
584and
585.Dv SA_RESETHAND
586flags are intended for backwards compatibility with other operating
587systems. The
588.Dv SA_NOCLDSTOP ,

--- 23 unchanged lines hidden ---