sig_names.h 2.2 KB

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