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