Deleted Added
sdiff udiff text old ( 81352 ) new ( 81622 )
full compact
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 $
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
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),
489so a function pointer of a BSD-style function needs to be casted to
490compile without warning.
491The traditional BSD style 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
503argument of the BSD-style handler 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
517argument to a BSD-style handler 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
570.Tn BSD 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 ---