signal.5 (2010 09)
s
signal(5) signal(5)
void (*bsd_signal(int sig, void (*func)(int)))(int);
int kill(pid_t pid, int sig);
int killpg(pid_t pgrp, int sig);
int raise(int sig);
int sigaction(int sig, const struct sigaction
*act, struct sigaction *oact);
int sigaddset(sigset_t *set, int signo);
int sigaltstack(const stack_t *ss, stack_t *oss);
int sigdelset(sigset_t *set, int signo);
int sigemptyset(sigset_t *set);
int sigfillset(sigset_t *set);
int sighold(int sig);
int sigignore(int sig);
int siginterrupt(int sig, int flag);
int sigismember(const sigset_t *set, int signo);
int sigmask(int signum);
void (*signal(int sig, void (*func)(int)))(int);
int sigpause(int sig);
int sigpending(sigset_t *set);
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
int sigqueue(pid_t pid, int sig, const union sigval value);
int sigrelse(int sig);
void *sigset(int sig, void (*disp)(int)))(int);
int sigstack(struct sigstack *ss,
struct sigstack *oss);
int sigsuspend(const sigset_t *sigmask);
int sigtimedwait(const sigset_t *set, siginfo_t * info,
const struct timespec *timeout);
int sigwait(const sigset_t *set, int *sig);
int sigwaitinfo(const sigset_t *set, siginfo_t * info);
APPLICATION USAGE
Upon receipt of the signal, if signal() is used to set the action to the address of a signal handler, the
action for the signal caught is reset to SIG_DFL (except SKGILL, SIGTRAP, and SIGPWR
). Then, the
signal-catching function is executed. Signal interface routines other than
signal() normally do not
reset the action for the signal caught. However,
sigaction() provides a way of specifying this
behavior.
The parameters passed to the signal-catching function where
signal() is used are:
int sig The signal number.
int code A word of information usually provided
by the hardware.
struct sigcontext *scp A pointer to the machine-dependent
structure sigcontext defined in
<signal.h>.
The parameters passed to the signal-catching function where
sigaction() is used and SA_SIGINFO
is not specified are:
int sig The signal number.
The parameters passed to the signal-catching function where
sigaction() is used and SA_SIGINFO
is specified are:
int sig The signal number.
siginfo_t *siginfop Information on why the signal was
generated.
void *contextp Can be cast to a pointer to a ucontext_t
6 Hewlett-Packard Company − 6 − HP-UX 11i Version 3: September 2010