root/kern/include/kern/signal.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 1982, 1986, 1989, 1991, 1993
   3  *      The Regents of the University of California.  All rights reserved.
   4  * (c) UNIX System Laboratories, Inc.
   5  * All or some portions of this file are derived from material licensed
   6  * to the University of California by American Telephone and Telegraph
   7  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
   8  * the permission of UNIX System Laboratories, Inc.
   9  *
  10  * Redistribution and use in source and binary forms, with or without
  11  * modification, are permitted provided that the following conditions
  12  * are met:
  13  * 1. Redistributions of source code must retain the above copyright
  14  *    notice, this list of conditions and the following disclaimer.
  15  * 2. Redistributions in binary form must reproduce the above copyright
  16  *    notice, this list of conditions and the following disclaimer in the
  17  *    documentation and/or other materials provided with the distribution.
  18  * 3. Neither the name of the University nor the names of its contributors
  19  *    may be used to endorse or promote products derived from this software
  20  *    without specific prior written permission.
  21  *
  22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32  * SUCH DAMAGE.
  33  *
  34  *      @(#)signal.h    8.4 (Berkeley) 5/4/95
  35  */
  36 
  37 #ifndef _KERN_SIGNAL_H_
  38 #define _KERN_SIGNAL_H_
  39 
  40 /*
  41  * Machine-independent definitions for signals.
  42  */
  43  
  44 
  45 /*
  46  * The signals.
  47  *
  48  * The values of many of these are "well known", particularly 1, 9,
  49  * 10, and 11.
  50  *
  51  * Note that Unix signals are a semantic cesspool; many have special
  52  * properties or are supposed to interact with the system in special
  53  * ways. It is gross.
  54  */
  55 
  56 #define SIGHUP          1       /* Hangup */
  57 #define SIGINT          2       /* Interrupt (^C) */
  58 #define SIGQUIT         3       /* Quit (typically ^\) */
  59 #define SIGILL          4       /* Illegal instruction */
  60 #define SIGTRAP         5       /* Breakpoint trap */
  61 #define SIGABRT         6       /* abort() call */
  62 #define SIGEMT          7       /* Emulator trap */
  63 #define SIGFPE          8       /* Floating point exception */
  64 #define SIGKILL         9       /* Hard kill (unblockable) */
  65 #define SIGBUS          10      /* Bus error, typically bad pointer alignment*/
  66 #define SIGSEGV         11      /* Segmentation fault */
  67 #define SIGSYS          12      /* Bad system call */
  68 #define SIGPIPE         13      /* Broken pipe */
  69 #define SIGALRM         14      /* alarm() expired */
  70 #define SIGTERM         15      /* Termination requested (default kill) */
  71 #define SIGURG          16      /* Urgent data on socket */
  72 #define SIGSTOP         17      /* Hard process stop (unblockable) */
  73 #define SIGTSTP         18      /* Terminal stop (^Z) */
  74 #define SIGCONT         19      /* Time to continue after stop */
  75 #define SIGCHLD         20      /* Child process exited */
  76 #define SIGTTIN         21      /* Stop on tty read while in background */
  77 #define SIGTTOU         22      /* Stop on tty write while in background */
  78 #define SIGIO           23      /* Nonblocking or async I/O is now ready */
  79 #define SIGXCPU         24      /* CPU time resource limit exceeded */
  80 #define SIGXFSZ         25      /* File size resource limit exceeded */
  81 #define SIGVTALRM       26      /* Like SIGALRM but in virtual time */
  82 #define SIGPROF         27      /* Profiling timer */
  83 #define SIGWINCH        28      /* Window size change on tty */
  84 #define SIGINFO         29      /* Information request (typically ^T) */
  85 #define SIGUSR1         20      /* Application-defined */
  86 #define SIGUSR2         31      /* Application-defined */
  87 #define SIGPWR          32      /* Power failure */
  88 #define _NSIG           32
  89 
  90 
  91 /* Type for a set of signals; used by e.g. sigprocmask(). */
  92 typedef __u32 sigset_t;
  93 
  94 /* flags for sigaction.sa_flags */
  95 #define SA_ONSTACK      1       /* Use sigaltstack() stack. */
  96 #define SA_RESTART      2       /* Restart syscall instead of interrupting. */
  97 #define SA_RESETHAND    4       /* Clear handler after one usage. */
  98 
  99 /* codes for sigprocmask() */
 100 #define SIG_BLOCK       1       /* Block selected signals. */
 101 #define SIG_UNBLOCK     2       /* Unblock selected signals. */
 102 #define SIG_SETMASK     3       /* Set mask to the selected signals. */
 103 
 104 /* Type for a signal handler function. */
 105 typedef void (*__sigfunc)(int);
 106 
 107 /* Magic values for signal handlers. */
 108 #define SIG_DFL         ((__sigfunc) 0)         /* Default behavior. */
 109 #define SIG_IGN         ((__sigfunc) 1)         /* Ignore the signal. */
 110 
 111 /*
 112  * Struct for sigaction().
 113  */
 114 struct sigaction {
 115         __sigfunc sa_handler;
 116         sigset_t sa_mask;
 117         unsigned sa_flags;
 118 };
 119 
 120 /*
 121  * Struct for sigaltstack().
 122  * (not very important)
 123  */
 124 struct sigaltstack {
 125         void *ss_sp;
 126         size_t ss_size;
 127         unsigned ss_flags;
 128 };
 129 
 130 
 131 #endif /* _KERN_SIGNAL_H_ */

/* [<][>][^][v][top][bottom][index][help] */