os161-1.99
 All Data Structures
signal.h
00001 /*
00002  * Copyright (c) 1982, 1986, 1989, 1991, 1993
00003  *      The Regents of the University of California.  All rights reserved.
00004  * (c) UNIX System Laboratories, Inc.
00005  * All or some portions of this file are derived from material licensed
00006  * to the University of California by American Telephone and Telegraph
00007  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
00008  * the permission of UNIX System Laboratories, Inc.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  * 3. Neither the name of the University nor the names of its contributors
00019  *    may be used to endorse or promote products derived from this software
00020  *    without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00023  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00025  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00026  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00028  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00029  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00031  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  *      @(#)signal.h    8.4 (Berkeley) 5/4/95
00035  */
00036 
00037 #ifndef _KERN_SIGNAL_H_
00038 #define _KERN_SIGNAL_H_
00039 
00040 /*
00041  * Machine-independent definitions for signals.
00042  */
00043  
00044 
00045 /*
00046  * The signals.
00047  *
00048  * The values of many of these are "well known", particularly 1, 9,
00049  * 10, and 11.
00050  *
00051  * Note that Unix signals are a semantic cesspool; many have special
00052  * properties or are supposed to interact with the system in special
00053  * ways. It is gross.
00054  */
00055 
00056 #define SIGHUP          1       /* Hangup */
00057 #define SIGINT          2       /* Interrupt (^C) */
00058 #define SIGQUIT         3       /* Quit (typically ^\) */
00059 #define SIGILL          4       /* Illegal instruction */
00060 #define SIGTRAP         5       /* Breakpoint trap */
00061 #define SIGABRT         6       /* abort() call */
00062 #define SIGEMT          7       /* Emulator trap */
00063 #define SIGFPE          8       /* Floating point exception */
00064 #define SIGKILL         9       /* Hard kill (unblockable) */
00065 #define SIGBUS          10      /* Bus error, typically bad pointer alignment*/
00066 #define SIGSEGV         11      /* Segmentation fault */
00067 #define SIGSYS          12      /* Bad system call */
00068 #define SIGPIPE         13      /* Broken pipe */
00069 #define SIGALRM         14      /* alarm() expired */
00070 #define SIGTERM         15      /* Termination requested (default kill) */
00071 #define SIGURG          16      /* Urgent data on socket */
00072 #define SIGSTOP         17      /* Hard process stop (unblockable) */
00073 #define SIGTSTP         18      /* Terminal stop (^Z) */
00074 #define SIGCONT         19      /* Time to continue after stop */
00075 #define SIGCHLD         20      /* Child process exited */
00076 #define SIGTTIN         21      /* Stop on tty read while in background */
00077 #define SIGTTOU         22      /* Stop on tty write while in background */
00078 #define SIGIO           23      /* Nonblocking or async I/O is now ready */
00079 #define SIGXCPU         24      /* CPU time resource limit exceeded */
00080 #define SIGXFSZ         25      /* File size resource limit exceeded */
00081 #define SIGVTALRM       26      /* Like SIGALRM but in virtual time */
00082 #define SIGPROF         27      /* Profiling timer */
00083 #define SIGWINCH        28      /* Window size change on tty */
00084 #define SIGINFO         29      /* Information request (typically ^T) */
00085 #define SIGUSR1         20      /* Application-defined */
00086 #define SIGUSR2         31      /* Application-defined */
00087 #define SIGPWR          32      /* Power failure */
00088 #define _NSIG           32
00089 
00090 
00091 /* Type for a set of signals; used by e.g. sigprocmask(). */
00092 typedef __u32 sigset_t;
00093 
00094 /* flags for sigaction.sa_flags */
00095 #define SA_ONSTACK      1       /* Use sigaltstack() stack. */
00096 #define SA_RESTART      2       /* Restart syscall instead of interrupting. */
00097 #define SA_RESETHAND    4       /* Clear handler after one usage. */
00098 
00099 /* codes for sigprocmask() */
00100 #define SIG_BLOCK       1       /* Block selected signals. */
00101 #define SIG_UNBLOCK     2       /* Unblock selected signals. */
00102 #define SIG_SETMASK     3       /* Set mask to the selected signals. */
00103 
00104 /* Type for a signal handler function. */
00105 typedef void (*__sigfunc)(int);
00106 
00107 /* Magic values for signal handlers. */
00108 #define SIG_DFL         ((__sigfunc) 0)         /* Default behavior. */
00109 #define SIG_IGN         ((__sigfunc) 1)         /* Ignore the signal. */
00110 
00111 /*
00112  * Struct for sigaction().
00113  */
00114 struct sigaction {
00115         __sigfunc sa_handler;
00116         sigset_t sa_mask;
00117         unsigned sa_flags;
00118 };
00119 
00120 /*
00121  * Struct for sigaltstack().
00122  * (not very important)
00123  */
00124 struct sigaltstack {
00125         void *ss_sp;
00126         size_t ss_size;
00127         unsigned ss_flags;
00128 };
00129 
00130 
00131 #endif /* _KERN_SIGNAL_H_ */
 All Data Structures