signal.h

Go to the documentation of this file.
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. All advertising materials mentioning features or use of this software
00019  *    must display the following acknowledgement:
00020  *      This product includes software developed by the University of
00021  *      California, Berkeley and its contributors.
00022  * 4. Neither the name of the University nor the names of its contributors
00023  *    may be used to endorse or promote products derived from this software
00024  *    without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00027  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00029  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00030  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00031  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00032  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00033  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00034  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00035  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00036  * SUCH DAMAGE.
00037  *
00038  *      @(#)signal.h    8.4 (Berkeley) 5/4/95
00039  */
00040 #ifndef __SYSINTERF_SIGNAL_H__
00041 #define __SYSINTERF_SIGNAL_H__
00042 
00043 #define NSIG            64      
00045 #define SIGHUP          1       
00046 #define SIGINT          2       
00047 #define SIGQUIT         3       
00048 #define SIGILL          4       
00049 #define SIGTRAP         5       
00050 #define SIGABRT         6       
00051 #define SIGEMT          7       
00052 #define SIGFPE          8       
00053 #define SIGKILL         9       
00054 #define SIGBUS          10      
00055 #define SIGSEGV         11      
00056 #define SIGSYS          12      
00057 #define SIGPIPE         13      
00058 #define SIGALRM         14      
00059 #define SIGTERM         15      
00060 #define SIGURG          16      
00061 #define SIGSTOP         17      
00062 #define SIGTSTP         18      
00063 #define SIGCONT         19      
00064 #define SIGCHLD         20      
00065 #define SIGTTIN         21      
00066 #define SIGTTOU         22      
00067 #define SIGIO           23      
00068 #define SIGXCPU         24      
00069 #define SIGXFSZ         25      
00070 #define SIGVTALRM       26      
00071 #define SIGPROF         27      
00072 #define SIGWINCH        28      
00073 #define SIGINFO         29      
00074 #define SIGUSR1         30      
00075 #define SIGUSR2         31      
00076 #define SIGPWR          32      
00077 #define SIGNOTIFY       33      
00078 #define SIGSMP          34      
00079 #define SIGVM86         35
00080 #define SIGMAX          35      
00082 #define SIG_DFL         ((void (*) (int))  0)
00083 #define SIG_IGN         ((void (*) (int))  1)
00084 #define SIG_ERR         ((void (*) (int)) -1)
00085 
00086 typedef struct 
00087 {
00088   u_int32_t     __bits[4];
00089 } sigset_t;
00090 
00091 /*
00092  * Flags for sigprocmask():
00093  */
00094 #define SIG_BLOCK       1       
00095 #define SIG_UNBLOCK     2       
00096 #define SIG_SETMASK     3       
00098 /*
00099  * Macros for manipulating signal masks.
00100  */
00101 #define __sigmask(n)            (1 << (((unsigned int)(n) - 1) & 31))
00102 #define __sigword(n)            (((unsigned int)(n) - 1) >> 5)
00103 #define __sigisempty(s)         ((s)->__bits[0] == 0u &&\
00104                                  (s)->__bits[1] == 0u &&\
00105                                  (s)->__bits[2] == 0u &&\
00106                                  (s)->__bits[3] == 0u)
00107 #define __sigaddset(s, n)       ((s)->__bits[__sigword(n)] |= __sigmask(n))
00108 #define __sigdelset(s, n)       ((s)->__bits[__sigword(n)] &= ~__sigmask(n))
00109 #define __sigismember(s, n)     (((s)->__bits[__sigword(n)] & __sigmask(n)) != 0)
00110 #define __sigemptyset(s)        ((s)->__bits[0] = 0x00000000, \
00111                                  (s)->__bits[1] = 0x00000000, \
00112                                  (s)->__bits[2] = 0x00000000, \
00113                                  (s)->__bits[3] = 0x00000000)
00114 #define __sigfillset(s)         ((s)->__bits[0] = 0xffffffff, \
00115                                  (s)->__bits[1] = 0xffffffff, \
00116                                  (s)->__bits[2] = 0xffffffff, \
00117                                  (s)->__bits[3] = 0xffffffff)
00118 
00119 /*
00120  * real proto is void (*sig_t) __P((int sig, int code, struct sigcontext *scp))
00121  */
00122 typedef void (*sig_t)(int);       
00124 struct sigaction 
00125 {
00126   void     (*sa_handler)(int);
00127   sigset_t sa_mask;
00128   int      sa_flags;
00129 #define SA_ONSTACK      0x0001  
00130 #define SA_RESTART      0x0002  
00131 #define SA_RESETHAND    0x0004  
00132 #define SA_NODEFER      0x0010  
00133   /* Only valid for SIGCHLD. */
00134 #define SA_NOCLDSTOP    0x0008  
00135 #define SA_NOCLDWAIT    0x0020  
00136 };
00137 
00138 typedef struct sigaltstack
00139 {
00140   void    *ss_sp;                 
00141   size_t  ss_size;                
00142 #define MINSIGSTKSZ 8192                    
00143 #define SIGSTKSZ    (MINSIGSTKSZ + 32768)   
00144   int     ss_flags;               
00145 #define SS_ONSTACK  0x0001  
00146 #define SS_DISABLE  0x0004  
00147 } stack_t;
00148 
00149 /*
00150  * lseos specific
00151  */
00152 struct sigaction2
00153 {
00154   struct sigaction      sa2_sa;
00155   void                  *sa2_sp;
00156 };
00157 
00158 /*
00159  * sigcodes are mostly borrowed from rt/linux
00160  */
00161 /*
00162  * SIGILL sigcodes
00163  */
00164 #define ILL_ILLOPC 1 
00165 #define ILL_ILLOPN 2 
00166 #define ILL_ILLADR 3 
00167 #define ILL_ILLTRP 4 
00168 #define ILL_PRVOPC 5 
00169 #define ILL_PRVREG 6 
00170 #define ILL_COPROC 7 
00171 #define ILL_BADSTK 8 
00172 #define NSIGILL 8 
00173 
00174 /*
00175  * SIGFPE sigcodes
00176  */
00177 #define FPE_INTDIV 1 
00178 #define FPE_INTOVF 2 
00179 #define FPE_FLTDIV 3 
00180 #define FPE_FLTOVF 4 
00181 #define FPE_FLTUND 5 
00182 #define FPE_FLTRES 6 
00183 #define FPE_FLTINV 7 
00184 #define FPE_FLTSUB 8 
00185 #define NSIGFPE 8 
00186 
00187 /*
00188  * SIGSEGV sigcodes
00189  */ 
00190 #define SEGV_MAPERR 1 
00191 #define SEGV_ACCERR 2 
00192 #define SEGV_ACCERR2 3 
00193 #define SEGV_WIREERR 4 
00194 #define NSIGSEGV 2 
00195 
00196 /*
00197  * SIGBUS sigcodes
00198  */
00199 #define BUS_ADRALN 1 
00200 #define BUS_ADRERR 2 
00201 #define BUS_OBJERR 3 
00202 #define NSIGBUS 3
00203  
00204 /*
00205  * SIGTRAP sigcodes
00206  */
00207 #define TRAP_BRKPT 1 
00208 #define TRAP_TRACE 2 
00209 #define NSIGTRAP 2 
00210 
00211 #endif

Generated on Wed May 24 23:04:17 2006 for LSE/OS by  doxygen 1.4.6