00001 /* clib/include/signal.h 00002 * 00003 * Fake signal interface to ease porting of apps. ABLE will not deliver any 00004 * signals to your applications. 00005 * 00006 * Copyright 2003 Simtec Electronics 00007 * 00008 * Permission is hereby granted, free of charge, to any person 00009 * obtaining a copy of this software and associated documentation 00010 * files (the "Software"), to deal in the Software without 00011 * restriction, including without limitation the rights to use, copy, 00012 * modify, merge, publish, distribute, sublicense, and/or sell copies 00013 * of the Software, and to permit persons to whom the Software is 00014 * furnished to do so, subject to the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be 00017 * included in all copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00020 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00021 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00022 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00023 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00024 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00025 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00026 * SOFTWARE. 00027 * 00028 */ 00029 00030 #ifndef _ABLE_CLIB_SIGNAL_H 00031 #define _ABLE_CLIB_SIGNAL_H 1 00032 00033 typedef struct { 00034 unsigned long val; 00035 } sigset_t; 00036 00037 /* Values for the HOW argument to sigprocmask. */ 00038 #define SIG_BLOCK 0 /* Block signals. */ 00039 #define SIG_UNBLOCK 1 /* Unblock signals. */ 00040 #define SIG_SETMASK 2 /* Set the set of blocked signals. */ 00041 00042 /* Fake signal functions. */ 00043 #define SIG_ERR ((sighandler_t) -1) /* Error return. */ 00044 #define SIG_DFL ((sighandler_t) 0) /* Default action. */ 00045 #define SIG_IGN ((sighandler_t) 1) /* Ignore signal. */ 00046 00047 /* Signals. */ 00048 #define SIGHUP 1 /* Hangup (POSIX). */ 00049 #define SIGINT 2 /* Interrupt (ANSI). */ 00050 #define SIGQUIT 3 /* Quit (POSIX). */ 00051 #define SIGILL 4 /* Illegal instruction (ANSI). */ 00052 #define SIGTRAP 5 /* Trace trap (POSIX). */ 00053 #define SIGABRT 6 /* Abort (ANSI). */ 00054 #define SIGIOT 6 /* IOT trap (4.2 BSD). */ 00055 #define SIGBUS 7 /* BUS error (4.2 BSD). */ 00056 #define SIGFPE 8 /* Floating-point exception (ANSI). */ 00057 #define SIGKILL 9 /* Kill, unblockable (POSIX). */ 00058 #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ 00059 #define SIGSEGV 11 /* Segmentation violation (ANSI). */ 00060 #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ 00061 #define SIGPIPE 13 /* Broken pipe (POSIX). */ 00062 #define SIGALRM 14 /* Alarm clock (POSIX). */ 00063 #define SIGTERM 15 /* Termination (ANSI). */ 00064 #define SIGSTKFLT 16 /* Stack fault. */ 00065 #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ 00066 #define SIGCHLD 17 /* Child status has changed (POSIX). */ 00067 #define SIGCONT 18 /* Continue (POSIX). */ 00068 #define SIGSTOP 19 /* Stop, unblockable (POSIX). */ 00069 #define SIGTSTP 20 /* Keyboard stop (POSIX). */ 00070 #define SIGTTIN 21 /* Background read from tty (POSIX). */ 00071 #define SIGTTOU 22 /* Background write to tty (POSIX). */ 00072 #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ 00073 #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ 00074 #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ 00075 #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ 00076 #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ 00077 #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ 00078 #define SIGPOLL SIGIO /* Pollable event occurred (System V). */ 00079 #define SIGIO 29 /* I/O now possible (4.2 BSD). */ 00080 #define SIGPWR 30 /* Power failure restart (System V). */ 00081 #define SIGSYS 31 /* Bad system call. */ 00082 #define SIGUNUSED 31 00083 00084 #define _NSIG 64 /* Biggest signal number + 1 00085 * (including real-time signals). 00086 */ 00087 00088 00089 typedef void (*sighandler_t)(int); 00090 00091 sighandler_t signal(int signum, sighandler_t handler); 00092 00093 int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); 00094 00095 #endif /* _ABLE_CLIB_SIGNAL_H */