sl@0: /*- sl@0: * Copyright (c) 1982, 1986, 1989, 1991, 1993 sl@0: * The Regents of the University of California. All rights reserved. sl@0: * (c) UNIX System Laboratories, Inc. sl@0: * All or some portions of this file are derived from material licensed sl@0: * to the University of California by American Telephone and Telegraph sl@0: * Co. or Unix System Laboratories, Inc. and are reproduced herein with sl@0: * the permission of UNIX System Laboratories, Inc. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in the sl@0: * documentation and/or other materials provided with the distribution. sl@0: * 4. Neither the name of the University nor the names of its contributors sl@0: * may be used to endorse or promote products derived from this software sl@0: * without specific prior written permission. sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND sl@0: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE sl@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE sl@0: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL sl@0: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS sl@0: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT sl@0: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY sl@0: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF sl@0: * SUCH DAMAGE. sl@0: * sl@0: * @(#)signal.h 8.4 (Berkeley) 5/4/95 sl@0: * $FreeBSD: src/sys/sys/signal.h,v 1.45 2004/06/11 11:43:46 phk Exp $ sl@0: */ sl@0: sl@0: #ifndef _SYS_SIGNAL_H_ sl@0: #define _SYS_SIGNAL_H_ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include /* sig_atomic_t; trap codes; sigcontext */ sl@0: sl@0: /* sl@0: * System defined signals. sl@0: */ sl@0: #define SIGHUP 1 /* hangup */ sl@0: #define SIGINT 2 /* interrupt */ sl@0: #define SIGQUIT 3 /* quit */ sl@0: #define SIGILL 4 /* illegal instr. (not reset when caught) */ sl@0: #define SIGTRAP 5 /* trace trap (not reset when caught) */ sl@0: #define SIGABRT 6 /* abort() */ sl@0: #define SIGIOT SIGABRT /* compatibility */ sl@0: #define SIGEMT 7 /* EMT instruction */ sl@0: #define SIGFPE 8 /* floating point exception */ sl@0: #define SIGKILL 9 /* kill (cannot be caught or ignored) */ sl@0: #define SIGBUS 10 /* bus error */ sl@0: #define SIGSEGV 11 /* segmentation violation */ sl@0: #define SIGSYS 12 /* non-existent system call invoked */ sl@0: #define SIGPIPE 13 /* write on a pipe with no one to read it */ sl@0: #define SIGALRM 14 /* alarm clock */ sl@0: #define SIGTERM 15 /* software termination signal from kill */ sl@0: #define SIGURG 16 /* urgent condition on IO channel */ sl@0: #define SIGSTOP 17 /* sendable stop signal not from tty */ sl@0: #define SIGTSTP 18 /* stop signal from tty */ sl@0: #define SIGCONT 19 /* continue a stopped process */ sl@0: #define SIGCHLD 20 /* to parent on child stop or exit */ sl@0: #define SIGTTIN 21 /* to readers pgrp upon background tty read */ sl@0: #define SIGTTOU 22 /* like TTIN if (tp->t_local<OSTOP) */ sl@0: #define SIGIO 23 /* input/output possible signal */ sl@0: #define SIGXCPU 24 /* exceeded CPU time limit */ sl@0: #define SIGXFSZ 25 /* exceeded file size limit */ sl@0: #define SIGVTALRM 26 /* virtual time alarm */ sl@0: #define SIGPROF 27 /* profiling time alarm */ sl@0: #define SIGWINCH 28 /* window size changes */ sl@0: #define SIGINFO 29 /* information request */ sl@0: #define SIGUSR1 30 /* user defined signal 1 */ sl@0: #define SIGUSR2 31 /* user defined signal 2 */ sl@0: #define SIGTHR 32 /* Thread interrupt. */ sl@0: sl@0: #define SIGRTMIN 33 sl@0: #define SIGRTMAX 64 sl@0: /* sl@0: * XXX missing SIGRTMIN, SIGRTMAX. sl@0: */ sl@0: sl@0: #define SIG_DFL ((__sighandler_t *)0) sl@0: #define SIG_IGN ((__sighandler_t *)1) sl@0: #define SIG_ERR ((__sighandler_t *)-1) sl@0: #define SIG_HOLD ((__sighandler_t *)3) sl@0: sl@0: sl@0: /* sl@0: * XXX missing SIG_HOLD. sl@0: */ sl@0: sl@0: /*- sl@0: * Type of a signal handling function. sl@0: * sl@0: * Language spec sez signal handlers take exactly one arg, even though we sl@0: * actually supply three. Ugh! sl@0: * sl@0: * We don't try to hide the difference by leaving out the args because sl@0: * that would cause warnings about conformant programs. Nonconformant sl@0: * programs can avoid the warnings by casting to (__sighandler_t *) or sl@0: * sig_t before calling signal() or assigning to sa_handler or sv_handler. sl@0: * sl@0: * The kernel should reverse the cast before calling the function. It sl@0: * has no way to do this, but on most machines 1-arg and 3-arg functions sl@0: * have the same calling protocol so there is no problem in practice. sl@0: * A bit in sa_flags could be used to specify the number of args. sl@0: */ sl@0: typedef void __sighandler_t(int); sl@0: sl@0: #ifndef _SIGSET_T_DECLARED sl@0: #define _SIGSET_T_DECLARED sl@0: typedef __uint64_t sigset_t; sl@0: #endif sl@0: sl@0: #if __POSIX_VISIBLE || __XSI_VISIBLE sl@0: struct __siginfo_t; sl@0: sl@0: /* sl@0: * Signal vector "template" used in sigaction call. sl@0: */ sl@0: struct sigaction { sl@0: union { sl@0: void (*_sa_handler)(int); sl@0: void (*_sa_sigaction)(int, struct __siginfo_t*, void *); sl@0: } _sa_u; /* signal handler */ sl@0: int sa_flags; /* see signal options below */ sl@0: sigset_t sa_mask; /* signal mask to apply */ sl@0: }; sl@0: sl@0: #define sa_handler _sa_u._sa_handler sl@0: #define sa_sigaction _sa_u._sa_sigaction sl@0: sl@0: #endif sl@0: sl@0: #if __POSIX_VISIBLE || __XSI_VISIBLE sl@0: #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ sl@0: #endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ sl@0: sl@0: #if __XSI_VISIBLE sl@0: #define SA_ONSTACK 0x0001 /* take signal on signal stack */ sl@0: #define SA_RESTART 0x0002 /* restart system call on signal return */ sl@0: #define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ sl@0: #define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ sl@0: #define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ sl@0: #define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */ sl@0: #endif sl@0: sl@0: #if __BSD_VISIBLE sl@0: #define NSIG 32 /* number of old signals (counting 0) */ sl@0: #endif sl@0: sl@0: #endif /* !_SYS_SIGNAL_H_ */