Back to index

lightning-sunbird  0.9+nobinonly
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 Deleted as of 22Jul99, see
00019  *     ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
00020  *        for details]
00021  * 4. Neither the name of the University nor the names of its contributors
00022  *    may be used to endorse or promote products derived from this software
00023  *    without specific prior written permission.
00024  *
00025  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00026  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00028  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00029  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00031  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00032  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00033  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00034  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00035  * SUCH DAMAGE.
00036  *
00037  *     @(#)signal.h  8.2 (Berkeley) 1/21/94
00038  */
00039 
00040 /* Adapted for GUSI by Matthias Neeracher <neeri@iis.ee.ethz.ch> */
00041 
00042 #ifndef       _SYS_SIGNAL_H_
00043 #define       _SYS_SIGNAL_H_
00044 
00045 #include <sys/cdefs.h>
00046 
00047 #define NSIG  32            /* counting 0; could be 33 (mask is 1-32) */
00048 
00049 #ifndef _ANSI_SOURCE
00050 #include <machine/signal.h> /* sigcontext; codes for SIGILL, SIGFPE */
00051 #endif
00052 
00053 __BEGIN_DECLS
00054 typedef void (*__sig_handler)(int);
00055 __END_DECLS
00056 
00057 /* 1 is SIGABRT for MPW and CW */
00058 #define       SIGINT 2      /* interrupt */
00059 #define       SIGQUIT       3      /* quit */
00060 /* 4 is SIGINT for CW */
00061 #define       SIGABRT       6      /* abort() */
00062 #define       SIGFPE 8      /* floating point exception */
00063 #define       SIGKILL       9      /* kill (cannot be caught or ignored) */
00064 #define       SIGSEGV       11     /* segmentation violation */
00065 #define       SIGPIPE       13     /* write on a pipe with no one to read it */
00066 #define       SIGALRM       14     /* alarm clock */
00067 #define       SIGTERM       15     /* software termination signal from kill */
00068 #ifndef _POSIX_SOURCE
00069 #define       SIGURG 16     /* urgent condition on IO channel */
00070 #endif
00071 #define       SIGSTOP       17     /* sendable stop signal not from tty */
00072 #define       SIGTSTP       18     /* stop signal from tty */
00073 #define       SIGCONT       19     /* continue a stopped process */
00074 #define       SIGCHLD       20     /* to parent on child stop or exit */
00075 #define       SIGTTIN       21     /* to readers pgrp upon background tty read */
00076 #define       SIGTTOU       22     /* like TTIN for output if (tp->t_local&LTOSTOP) */
00077 #define       SIGHUP 24     /* hangup */
00078 #define       SIGILL 25     /* illegal instruction (not reset when caught) */
00079 #ifndef _POSIX_SOURCE
00080 #define       SIGIO  23     /* input/output possible signal */
00081 #define       SIGPROF       27     /* profiling time alarm */
00082 #define SIGWINCH 28  /* window size changes */
00083 #endif
00084 #define SIGUSR1 30   /* user defined signal 1 */
00085 #define SIGUSR2 31   /* user defined signal 2 */
00086 
00087 #define       SIG_DFL              (__sig_handler)0
00088 #define       SIG_IGN              (__sig_handler)1
00089 #define       SIG_ERR              (__sig_handler)-1
00090 
00091 #ifndef _ANSI_SOURCE
00092 typedef unsigned int sigset_t;
00093 
00094 /*
00095  * Signal vector "template" used in sigaction call.
00096  */
00097 struct sigaction {
00098        __sig_handler        sa_handler;   /* signal handler */
00099        sigset_t             sa_mask;             /* signal mask to apply */
00100        int                         sa_flags;            /* see signal options below */
00101 };
00102 #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop  */
00103 #define SA_RESETHAND 0x0001 /* emulate ANSI signals                                 */
00104 #define SA_RESTART          0x0002 /* restart slow system calls                            */
00105 #define SA_NODEFER          0x0004 /* don't block current signal                           */
00106 
00107 /*
00108  * Flags for sigprocmask:
00109  */
00110 #define       SIG_BLOCK     1      /* block specified signal set */
00111 #define       SIG_UNBLOCK   2      /* unblock specified signal set */
00112 #define       SIG_SETMASK   3      /* set specified signal set */
00113 
00114 #endif /* !_ANSI_SOURCE */
00115 
00116 /*
00117  * For historical reasons; programs expect signal's return value to be
00118  * defined by <sys/signal.h>.
00119  */
00120 __BEGIN_DECLS
00121 __sig_handler signal __P((int, __sig_handler));
00122 __END_DECLS
00123 #endif /* !_SYS_SIGNAL_H_ */