1 #include <linux/signal.h> 2 3 #define SIGUNKNOWN 0 4 #define MAXMAPPED_SIG 35 5 #define MAXMAPPED_SIGNAME (MAXMAPPED_SIG + 1) 6 #define SIGRT_BASE 128 7 8 /* provide a mapping of arch signal to internal signal # for mediation 9 * those that are always an alias SIGCLD for SIGCLHD and SIGPOLL for SIGIO 10 * map to the same entry those that may/or may not get a separate entry 11 */ 12 static const int sig_map[MAXMAPPED_SIG] = { 13 [0] = MAXMAPPED_SIG, /* existence test */ 14 [SIGHUP] = 1, 15 [SIGINT] = 2, 16 [SIGQUIT] = 3, 17 [SIGILL] = 4, 18 [SIGTRAP] = 5, /* -, 5, - */ 19 [SIGABRT] = 6, /* SIGIOT: -, 6, - */ 20 [SIGBUS] = 7, /* 10, 7, 10 */ 21 [SIGFPE] = 8, 22 [SIGKILL] = 9, 23 [SIGUSR1] = 10, /* 30, 10, 16 */ 24 [SIGSEGV] = 11, 25 [SIGUSR2] = 12, /* 31, 12, 17 */ 26 [SIGPIPE] = 13, 27 [SIGALRM] = 14, 28 [SIGTERM] = 15, 29 #ifdef SIGSTKFLT 30 [SIGSTKFLT] = 16, /* -, 16, - */ 31 #endif 32 [SIGCHLD] = 17, /* 20, 17, 18. SIGCHLD -, -, 18 */ 33 [SIGCONT] = 18, /* 19, 18, 25 */ 34 [SIGSTOP] = 19, /* 17, 19, 23 */ 35 [SIGTSTP] = 20, /* 18, 20, 24 */ 36 [SIGTTIN] = 21, /* 21, 21, 26 */ 37 [SIGTTOU] = 22, /* 22, 22, 27 */ 38 [SIGURG] = 23, /* 16, 23, 21 */ 39 [SIGXCPU] = 24, /* 24, 24, 30 */ 40 [SIGXFSZ] = 25, /* 25, 25, 31 */ 41 [SIGVTALRM] = 26, /* 26, 26, 28 */ 42 [SIGPROF] = 27, /* 27, 27, 29 */ 43 [SIGWINCH] = 28, /* 28, 28, 20 */ 44 [SIGIO] = 29, /* SIGPOLL: 23, 29, 22 */ 45 [SIGPWR] = 30, /* 29, 30, 19. SIGINFO 29, -, - */ 46 #ifdef SIGSYS 47 [SIGSYS] = 31, /* 12, 31, 12. often SIG LOST/UNUSED */ 48 #endif 49 #ifdef SIGEMT 50 [SIGEMT] = 32, /* 7, - , 7 */ 51 #endif 52 #if defined(SIGLOST) && SIGPWR != SIGLOST /* sparc */ 53 [SIGLOST] = 33, /* unused on Linux */ 54 #endif 55 #if defined(SIGUNUSED) && \ 56 defined(SIGLOST) && defined(SIGSYS) && SIGLOST != SIGSYS 57 [SIGUNUSED] = 34, /* -, 31, - */ 58 #endif 59 }; 60 61 /* this table is ordered post sig_map[sig] mapping */ 62 static const char *const sig_names[MAXMAPPED_SIGNAME] = { 63 "unknown", 64 "hup", 65 "int", 66 "quit", 67 "ill", 68 "trap", 69 "abrt", 70 "bus", 71 "fpe", 72 "kill", 73 "usr1", 74 "segv", 75 "usr2", 76 "pipe", 77 "alrm", 78 "term", 79 "stkflt", 80 "chld", 81 "cont", 82 "stop", 83 "stp", 84 "ttin", 85 "ttou", 86 "urg", 87 "xcpu", 88 "xfsz", 89 "vtalrm", 90 "prof", 91 "winch", 92 "io", 93 "pwr", 94 "sys", 95 "emt", 96 "lost", 97 "unused", 98 99 "exists", /* always last existence test mapped to MAXMAPPED_SIG */ 100 }; 101 102