1da2e3ebdSchin /*********************************************************************** 2da2e3ebdSchin * * 3da2e3ebdSchin * This software is part of the ast package * 43e14f97fSRoger A. Faulkner * Copyright (c) 1982-2010 AT&T Intellectual Property * 5da2e3ebdSchin * and is licensed under the * 6da2e3ebdSchin * Common Public License, Version 1.0 * 77c2fbfb3SApril Chin * by AT&T Intellectual Property * 8da2e3ebdSchin * * 9da2e3ebdSchin * A copy of the License is available at * 10da2e3ebdSchin * http://www.opensource.org/licenses/cpl1.0.txt * 11da2e3ebdSchin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 12da2e3ebdSchin * * 13da2e3ebdSchin * Information and Software Systems Research * 14da2e3ebdSchin * AT&T Research * 15da2e3ebdSchin * Florham Park NJ * 16da2e3ebdSchin * * 17da2e3ebdSchin * David Korn <dgk@research.att.com> * 18da2e3ebdSchin * * 19da2e3ebdSchin ***********************************************************************/ 20da2e3ebdSchin #include <ast.h> 21da2e3ebdSchin #include "shtable.h" 22da2e3ebdSchin #include "fault.h" 23da2e3ebdSchin 24da2e3ebdSchin #if defined(SIGCLD) && !defined(SIGCHLD) 25da2e3ebdSchin # define SIGCHLD SIGCLD 26da2e3ebdSchin #endif 27da2e3ebdSchin 287c2fbfb3SApril Chin #define VAL(sig,mode) ((sig+1)|((mode)<<SH_SIGBITS)) 29da2e3ebdSchin #define TRAP(n) (((n)|SH_TRAP)-1) 30da2e3ebdSchin 31da2e3ebdSchin #ifndef ERROR_dictionary 32da2e3ebdSchin # define ERROR_dictionary(s) (s) 33da2e3ebdSchin #endif 34da2e3ebdSchin #define S(s) ERROR_dictionary(s) 35da2e3ebdSchin 36da2e3ebdSchin /* 3734f9b3eeSRoland Mainz * This is a table that gives numbers and default settings to each signal. 3834f9b3eeSRoland Mainz * The signal numbers go in the low bits and the attributes go in the high bits. 3934f9b3eeSRoland Mainz * The names must be ASCII sorted lo-hi. 40da2e3ebdSchin */ 41da2e3ebdSchin 42da2e3ebdSchin const struct shtable2 shtab_signals[] = 43da2e3ebdSchin { 44da2e3ebdSchin #ifdef SIGABRT 45da2e3ebdSchin "ABRT", VAL(SIGABRT,SH_SIGDONE), S("Abort"), 46da2e3ebdSchin #endif /*SIGABRT */ 47da2e3ebdSchin #ifdef SIGAIO 48da2e3ebdSchin "AIO", VAL(SIGAIO,SH_SIGIGNORE), S("Asynchronous I/O"), 49da2e3ebdSchin #endif /*SIGAIO */ 50da2e3ebdSchin #ifdef SIGALRM 51da2e3ebdSchin "ALRM", VAL(SIGALRM,SH_SIGDONE), S("Alarm call"), 52da2e3ebdSchin #endif /* SIGALRM */ 5334f9b3eeSRoland Mainz #ifdef SIGALRM1 5434f9b3eeSRoland Mainz "ALRM1", VAL(SIGALRM1,SH_SIGDONE), S("Scheduling - reserved"), 5534f9b3eeSRoland Mainz #endif /* SIGALRM */ 56da2e3ebdSchin #ifdef SIGAPOLLO 5734f9b3eeSRoland Mainz "APOLLO", VAL(SIGAPOLLO,0), S("SIGAPOLLO"), 58da2e3ebdSchin #endif /* SIGAPOLLO */ 59da2e3ebdSchin #ifdef SIGBUS 60da2e3ebdSchin "BUS", VAL(SIGBUS,SH_SIGDONE), S("Bus error"), 61da2e3ebdSchin #endif /* SIGBUS */ 627c2fbfb3SApril Chin #ifdef SIGCANCEL 637c2fbfb3SApril Chin "CANCEL", VAL(SIGCANCEL,SH_SIGIGNORE), S("Thread cancellation"), 647c2fbfb3SApril Chin #endif /*SIGCANCEL */ 65da2e3ebdSchin #ifdef SIGCHLD 66da2e3ebdSchin "CHLD", VAL(SIGCHLD,SH_SIGFAULT), S("Death of Child"), 67da2e3ebdSchin # ifdef SIGCLD 68da2e3ebdSchin # if SIGCLD!=SIGCHLD 69da2e3ebdSchin "CLD", VAL(SIGCLD,SH_SIGFAULT), S("Death of Child"), 70da2e3ebdSchin # endif 71da2e3ebdSchin # endif /* SIGCLD */ 72da2e3ebdSchin #else 73da2e3ebdSchin # ifdef SIGCLD 74da2e3ebdSchin "CLD", VAL(SIGCLD,SH_SIGFAULT), S("Death of Child"), 75da2e3ebdSchin # endif /* SIGCLD */ 76da2e3ebdSchin #endif /* SIGCHLD */ 77da2e3ebdSchin #ifdef SIGCONT 78da2e3ebdSchin "CONT", VAL(SIGCONT,SH_SIGIGNORE), S("Stopped process continued"), 79da2e3ebdSchin #endif /* SIGCONT */ 8034f9b3eeSRoland Mainz #ifdef SIGCPUFAIL 8134f9b3eeSRoland Mainz "CPUFAIL", VAL(SIGCPUFAIL,0), S("Predictive processor deconfiguration"), 8234f9b3eeSRoland Mainz #endif /* SIGRETRACT */ 83da2e3ebdSchin "DEBUG", VAL(TRAP(SH_DEBUGTRAP),0), "", 847c2fbfb3SApril Chin #ifdef SIGDANGER 857c2fbfb3SApril Chin "DANGER", VAL(SIGDANGER,0), S("System crash soon"), 867c2fbfb3SApril Chin #endif /* SIGDANGER */ 87da2e3ebdSchin #ifdef SIGDIL 88da2e3ebdSchin "DIL", VAL(SIGDIL,0), S("DIL signal"), 89da2e3ebdSchin #endif /* SIGDIL */ 90da2e3ebdSchin #ifdef SIGEMT 91da2e3ebdSchin "EMT", VAL(SIGEMT,SH_SIGDONE), S("EMT trap"), 92da2e3ebdSchin #endif /* SIGEMT */ 93da2e3ebdSchin "ERR", VAL(TRAP(SH_ERRTRAP),0), "", 94da2e3ebdSchin #ifdef SIGERR 95da2e3ebdSchin "ERR", VAL(SIGERR,0), "", 96da2e3ebdSchin #endif /* SIGERR */ 97da2e3ebdSchin "EXIT", VAL(0,0), "", 98da2e3ebdSchin "FPE", VAL(SIGFPE,SH_SIGDONE), S("Floating exception"), 99da2e3ebdSchin #ifdef SIGFREEZE 100da2e3ebdSchin "FREEZE", VAL(SIGFREEZE,SH_SIGIGNORE), S("Special signal used by CPR"), 101da2e3ebdSchin #endif /* SIGFREEZE */ 10234f9b3eeSRoland Mainz #ifdef SIGGRANT 10334f9b3eeSRoland Mainz "GRANT", VAL(SIGGRANT,0), S("Grant monitor mode"), 10434f9b3eeSRoland Mainz #endif /* SIGGRANT */ 105da2e3ebdSchin "HUP", VAL(SIGHUP,SH_SIGDONE), S("Hangup"), 106da2e3ebdSchin "ILL", VAL(SIGILL,SH_SIGDONE), S("Illegal instruction"), 107*19d32b9aSRobert Mustacchi #ifdef SIGINFO 108*19d32b9aSRobert Mustacchi "INFO", VAL(SIGINFO,SH_SIGIGNORE), S("Information request"), 109*19d32b9aSRobert Mustacchi #endif /*SIGINFO */ 110da2e3ebdSchin #ifdef JOBS 111da2e3ebdSchin "INT", VAL(SIGINT,SH_SIGINTERACTIVE), S("Interrupt"), 112da2e3ebdSchin #else 113da2e3ebdSchin "INT", VAL(SIGINT,SH_SIGINTERACTIVE), "", 114da2e3ebdSchin #endif /* JOBS */ 115da2e3ebdSchin #ifdef SIGIO 11634f9b3eeSRoland Mainz "IO", VAL(SIGIO,SH_SIGDONE), S("IO signal"), 117da2e3ebdSchin #endif /* SIGIO */ 118da2e3ebdSchin #ifdef SIGIOT 119da2e3ebdSchin "IOT", VAL(SIGIOT,SH_SIGDONE), S("Abort"), 120da2e3ebdSchin #endif /* SIGIOT */ 1217c2fbfb3SApril Chin #ifdef SIGJVM1 1227c2fbfb3SApril Chin "JVM1", VAL(SIGJVM1,SH_SIGIGNORE), S("Special signal used by Java Virtual Machine"), 1237c2fbfb3SApril Chin #endif /*SIGJVM1 */ 1247c2fbfb3SApril Chin #ifdef SIGJVM2 1257c2fbfb3SApril Chin "JVM2", VAL(SIGJVM2,SH_SIGIGNORE), S("Special signal used by Java Virtual Machine"), 1267c2fbfb3SApril Chin #endif /*SIGJVM2 */ 127da2e3ebdSchin "KEYBD", VAL(TRAP(SH_KEYTRAP),0), "", 128da2e3ebdSchin #ifdef SIGKILL 129da2e3ebdSchin "KILL", VAL(SIGKILL,0), S("Killed"), 130da2e3ebdSchin #endif /* SIGKILL */ 131da2e3ebdSchin #ifdef SIGLAB 132da2e3ebdSchin "LAB", VAL(SIGLAB,0), S("Security label changed"), 133da2e3ebdSchin #endif /* SIGLAB */ 134da2e3ebdSchin #ifdef SIGLOST 135da2e3ebdSchin "LOST", VAL(SIGLOST,SH_SIGDONE), S("Resources lost"), 136da2e3ebdSchin #endif /* SIGLOST */ 137da2e3ebdSchin #ifdef SIGLWP 138da2e3ebdSchin "LWP", VAL(SIGLWP,SH_SIGIGNORE), S("Special signal used by thread library"), 139da2e3ebdSchin #endif /* SIGLWP */ 14034f9b3eeSRoland Mainz #ifdef SIGMIGRATE 14134f9b3eeSRoland Mainz "MIGRATE", VAL(SIGMIGRATE,0), S("Migrate process"), 14234f9b3eeSRoland Mainz #endif /* SIGMIGRATE */ 14334f9b3eeSRoland Mainz #ifdef SIGMSG 14434f9b3eeSRoland Mainz "MSG", VAL(SIGMSG,0), S("Ring buffer input data"), 14534f9b3eeSRoland Mainz #endif /* SIGMSG */ 146da2e3ebdSchin #ifdef SIGPHONE 147da2e3ebdSchin "PHONE", VAL(SIGPHONE,0), S("Phone interrupt"), 148da2e3ebdSchin #endif /* SIGPHONE */ 149da2e3ebdSchin #ifdef SIGPIPE 150da2e3ebdSchin #ifdef JOBS 151da2e3ebdSchin "PIPE", VAL(SIGPIPE,SH_SIGDONE), S("Broken Pipe"), 152da2e3ebdSchin #else 153da2e3ebdSchin "PIPE", VAL(SIGPIPE,SH_SIGDONE), "", 154da2e3ebdSchin #endif /* JOBS */ 155da2e3ebdSchin #endif /* SIGPIPE */ 156da2e3ebdSchin #ifdef SIGPOLL 157da2e3ebdSchin "POLL", VAL(SIGPOLL,SH_SIGDONE), S("Polling alarm"), 158da2e3ebdSchin #endif /* SIGPOLL */ 159da2e3ebdSchin #ifdef SIGPROF 160da2e3ebdSchin "PROF", VAL(SIGPROF,SH_SIGDONE), S("Profiling time alarm"), 161da2e3ebdSchin #endif /* SIGPROF */ 16234f9b3eeSRoland Mainz #ifdef SIGPRE 16334f9b3eeSRoland Mainz "PRE", VAL(SIGPRE,SH_SIGDONE), S("Programming exception"), 16434f9b3eeSRoland Mainz #endif /* SIGPRE */ 165da2e3ebdSchin #ifdef SIGPWR 166da2e3ebdSchin # if SIGPWR>0 167da2e3ebdSchin "PWR", VAL(SIGPWR,SH_SIGIGNORE), S("Power fail"), 168da2e3ebdSchin # endif 169da2e3ebdSchin #endif /* SIGPWR */ 170da2e3ebdSchin #ifdef SIGQUIT 171da2e3ebdSchin "QUIT", VAL(SIGQUIT,SH_SIGDONE|SH_SIGINTERACTIVE), S("Quit"), 172da2e3ebdSchin #endif /* SIGQUIT */ 17334f9b3eeSRoland Mainz #ifdef SIGRETRACT 17434f9b3eeSRoland Mainz "RETRACT", VAL(SIGRETRACT,0), S("Relinquish monitor mode"), 17534f9b3eeSRoland Mainz #endif /* SIGRETRACT */ 1767c2fbfb3SApril Chin #ifdef SIGRTMIN 1777c2fbfb3SApril Chin "RTMIN", VAL(SH_SIGRTMIN,SH_SIGRUNTIME), S("Lowest priority realtime signal"), 1787c2fbfb3SApril Chin #endif /* SIGRTMIN */ 1797c2fbfb3SApril Chin #ifdef SIGRTMAX 1807c2fbfb3SApril Chin "RTMAX", VAL(SH_SIGRTMAX,SH_SIGRUNTIME), S("Highest priority realtime signal"), 1817c2fbfb3SApril Chin #endif /* SIGRTMAX */ 18234f9b3eeSRoland Mainz #ifdef SIGSAK 18334f9b3eeSRoland Mainz "SAK", VAL(SIGSAK,0), S("Secure attention key"), 18434f9b3eeSRoland Mainz #endif /* SIGSAK */ 185da2e3ebdSchin "SEGV", VAL(SIGSEGV,0), S("Memory fault"), 18634f9b3eeSRoland Mainz #ifdef SIGSOUND 18734f9b3eeSRoland Mainz "SOUND", VAL(SIGSOUND,0), S("Sound completed"), 18834f9b3eeSRoland Mainz #endif /* SIGSOUND */ 189da2e3ebdSchin #ifdef SIGSTOP 190da2e3ebdSchin "STOP", VAL(SIGSTOP,0), S("Stopped (SIGSTOP)"), 191da2e3ebdSchin #endif /* SIGSTOP */ 192da2e3ebdSchin #ifdef SIGSYS 193da2e3ebdSchin "SYS", VAL(SIGSYS,SH_SIGDONE), S("Bad system call"), 194da2e3ebdSchin #endif /* SIGSYS */ 195da2e3ebdSchin "TERM", VAL(SIGTERM,SH_SIGDONE|SH_SIGINTERACTIVE), S("Terminated"), 19634f9b3eeSRoland Mainz #ifdef SIGTHAW 19734f9b3eeSRoland Mainz "THAW", VAL(SIGTHAW,SH_SIGIGNORE), S("Special signal used by CPR"), 19834f9b3eeSRoland Mainz #endif /* SIGTHAW */ 199da2e3ebdSchin #ifdef SIGTINT 200da2e3ebdSchin # ifdef JOBS 201da2e3ebdSchin "TINT", VAL(SIGTINT,0), S("Interrupt"), 202da2e3ebdSchin # else 20334f9b3eeSRoland Mainz "TINT", VAL(SIGTINT,0), "", 204da2e3ebdSchin # endif /* JOBS */ 205da2e3ebdSchin #endif /* SIGTINT */ 206da2e3ebdSchin #ifdef SIGTRAP 207da2e3ebdSchin "TRAP", VAL(SIGTRAP,SH_SIGDONE), S("Trace/BPT trap"), 208da2e3ebdSchin #endif /* SIGTRAP */ 209da2e3ebdSchin #ifdef SIGTSTP 210da2e3ebdSchin "TSTP", VAL(SIGTSTP,0), S("Stopped"), 211da2e3ebdSchin #endif /* SIGTSTP */ 212da2e3ebdSchin #ifdef SIGTTIN 213da2e3ebdSchin "TTIN", VAL(SIGTTIN,0), S("Stopped (SIGTTIN)"), 214da2e3ebdSchin #endif /* SIGTTIN */ 215da2e3ebdSchin #ifdef SIGTTOU 216da2e3ebdSchin "TTOU", VAL(SIGTTOU,0), S("Stopped(SIGTTOU)"), 217da2e3ebdSchin #endif /* SIGTTOU */ 218da2e3ebdSchin #ifdef SIGURG 219da2e3ebdSchin "URG", VAL(SIGURG,SH_SIGIGNORE), S("Socket interrupt"), 220da2e3ebdSchin #endif /* SIGURG */ 221da2e3ebdSchin #ifdef SIGUSR1 222da2e3ebdSchin "USR1", VAL(SIGUSR1,SH_SIGDONE), S("User signal 1"), 223da2e3ebdSchin #endif /* SIGUSR1 */ 224da2e3ebdSchin #ifdef SIGUSR2 225da2e3ebdSchin "USR2", VAL(SIGUSR2,SH_SIGDONE), S("User signal 2"), 226da2e3ebdSchin #endif /* SIGUSR2 */ 22734f9b3eeSRoland Mainz #ifdef SIGVIRT 22834f9b3eeSRoland Mainz "VIRT", VAL(SIGVIRT,0), S("Virtual timer alarm"), 22934f9b3eeSRoland Mainz #endif /* SIGVIRT */ 230da2e3ebdSchin #ifdef SIGVTALRM 231da2e3ebdSchin "VTALRM", VAL(SIGVTALRM,SH_SIGDONE), S("Virtual time alarm"), 232da2e3ebdSchin #endif /* SIGVTALRM */ 233da2e3ebdSchin #ifdef SIGWAITING 234da2e3ebdSchin "WAITING", VAL(SIGWAITING,SH_SIGIGNORE), S("All threads blocked"), 235da2e3ebdSchin #endif /* SIGWAITING */ 23634f9b3eeSRoland Mainz #ifdef SIGWINCH 23734f9b3eeSRoland Mainz "WINCH", VAL(SIGWINCH,SH_SIGIGNORE), S("Window size change"), 23834f9b3eeSRoland Mainz #endif /* SIGWINCH */ 239da2e3ebdSchin #ifdef SIGXCPU 240da2e3ebdSchin "XCPU", VAL(SIGXCPU,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded CPU time limit"), 241da2e3ebdSchin #endif /* SIGXCPU */ 242da2e3ebdSchin #ifdef SIGXFSZ 243da2e3ebdSchin "XFSZ", VAL(SIGXFSZ,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded file size limit"), 244da2e3ebdSchin #endif /* SIGXFSZ */ 2457c2fbfb3SApril Chin #ifdef SIGXRES 2467c2fbfb3SApril Chin "XRES", VAL(SIGXRES,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded resource control"), 2477c2fbfb3SApril Chin #endif /* SIGRES */ 248da2e3ebdSchin "", 0, 0 249da2e3ebdSchin }; 250