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 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
475either the ANSI C or traditional
476.Bx
477prototype and be pointed to by
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),
491so a function pointer of a
492.Bx Ns -style
493function needs to be casted to
494compile without warning.
495The traditional
496.Bx
497style is not portable and since its capabilities
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
509argument of the
510.Bx Ns -style
511handler and the
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
525argument to a
526.Bx Ns -style
527handler points to an instance of struct
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
580.Bx Ns \-derived
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 ---