.\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94
.\" $FreeBSD: src/lib/libc/sys/sigaction.2,v 1.48 2003/03/24 16:07:19 charnier Exp $
.\"
-.Dd April 3, 1994
+.Dd September 18, 2008
.Dt SIGACTION 2
.Os
.Sh NAME
.Sh SYNOPSIS
.In signal.h
.Bd -literal
+
struct sigaction {
- union {
- void (*__sa_handler)(int);
- void (*__sa_sigaction)(int, struct __siginfo *, void *);
- } __sigaction_u; /* signal handler */
- int sa_flags; /* see signal options below */
+ union __sigaction_u __sigaction_u; /* signal handler */
sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+
+union __sigaction_u {
+ void (*__sa_handler)(int);
+ void (*__sa_sigaction)(int, siginfo_t *,
+ void *);
};
#define sa_handler __sigaction_u.__sa_handler
#define sa_sigaction __sigaction_u.__sa_sigaction
+
.Ed
.Ft int
.Fo sigaction
.Fa "int sig"
-.Fa "const struct sigaction * restrict act"
-.Fa "struct sigaction * restrict oact"
+.Fa "const struct sigaction *restrict act"
+.Fa "struct sigaction *restrict oact"
.Fc
.Sh DESCRIPTION
The system defines a set of signals that may be delivered to a process.
Realtime Interfaces:
.Pp
.Fn aio_error ,
-.Fn clock_gettime ,
.Fn sigpause ,
-.Fn timer_getoverrun ,
.Fn aio_return ,
-.Fn fdatasync ,
-.Fn sigqueue ,
-.Fn timer_gettime ,
.Fn aio_suspend ,
.Fn sem_post ,
-.Fn sigset ,
-.Fn timer_settime .
+.Fn sigset .
.Pp
ANSI C Interfaces:
.Pp
will fail and no new signal handler will be installed if one
of the following occurs:
.Bl -tag -width Er
+.\" ===========
.It Bq Er EFAULT
Either
.Fa act
.Fa oact
points to memory that is not a valid part of the process
address space.
+.\" ===========
.It Bq Er EINVAL
The
.Fa sig
argument
is not a valid signal number.
+.\" ===========
.It Bq Er EINVAL
An attempt is made to ignore or supply a handler for
.Dv SIGKILL
or
.Dv SIGSTOP .
+.\" ===========
+.It Bq Er EINVAL
+An attempt was made to set the action to SIG_DFL
+for a signal that cannot be caught or ignored (or both).
.El
.Sh STANDARDS
The