signal.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __ASM_GENERIC_SIGNAL_H
  3. #define __ASM_GENERIC_SIGNAL_H
  4. #include <linux/types.h>
  5. #define _NSIG 64
  6. #define _NSIG_BPW __BITS_PER_LONG
  7. #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  8. #define SIGHUP 1
  9. #define SIGINT 2
  10. #define SIGQUIT 3
  11. #define SIGILL 4
  12. #define SIGTRAP 5
  13. #define SIGABRT 6
  14. #define SIGIOT 6
  15. #define SIGBUS 7
  16. #define SIGFPE 8
  17. #define SIGKILL 9
  18. #define SIGUSR1 10
  19. #define SIGSEGV 11
  20. #define SIGUSR2 12
  21. #define SIGPIPE 13
  22. #define SIGALRM 14
  23. #define SIGTERM 15
  24. #define SIGSTKFLT 16
  25. #define SIGCHLD 17
  26. #define SIGCONT 18
  27. #define SIGSTOP 19
  28. #define SIGTSTP 20
  29. #define SIGTTIN 21
  30. #define SIGTTOU 22
  31. #define SIGURG 23
  32. #define SIGXCPU 24
  33. #define SIGXFSZ 25
  34. #define SIGVTALRM 26
  35. #define SIGPROF 27
  36. #define SIGWINCH 28
  37. #define SIGIO 29
  38. #define SIGPOLL SIGIO
  39. /*
  40. #define SIGLOST 29
  41. */
  42. #define SIGPWR 30
  43. #define SIGSYS 31
  44. #define SIGUNUSED 31
  45. /* These should not be considered constants from userland. */
  46. #define SIGRTMIN 32
  47. #ifndef SIGRTMAX
  48. #define SIGRTMAX _NSIG
  49. #endif
  50. /*
  51. * SA_FLAGS values:
  52. *
  53. * SA_ONSTACK indicates that a registered stack_t will be used.
  54. * SA_RESTART flag to get restarting signals (which were the default long ago)
  55. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  56. * SA_RESETHAND clears the handler when the signal is delivered.
  57. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  58. * SA_NODEFER prevents the current signal from being masked in the handler.
  59. *
  60. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  61. * Unix names RESETHAND and NODEFER respectively.
  62. */
  63. #define SA_NOCLDSTOP 0x00000001
  64. #define SA_NOCLDWAIT 0x00000002
  65. #define SA_SIGINFO 0x00000004
  66. #define SA_ONSTACK 0x08000000
  67. #define SA_RESTART 0x10000000
  68. #define SA_NODEFER 0x40000000
  69. #define SA_RESETHAND 0x80000000
  70. #define SA_NOMASK SA_NODEFER
  71. #define SA_ONESHOT SA_RESETHAND
  72. /*
  73. * New architectures should not define the obsolete
  74. * SA_RESTORER 0x04000000
  75. */
  76. #if !defined MINSIGSTKSZ || !defined SIGSTKSZ
  77. #define MINSIGSTKSZ 2048
  78. #define SIGSTKSZ 8192
  79. #endif
  80. #ifndef __ASSEMBLY__
  81. typedef struct {
  82. unsigned long sig[_NSIG_WORDS];
  83. } sigset_t;
  84. /* not actually used, but required for linux/syscalls.h */
  85. typedef unsigned long old_sigset_t;
  86. #include <asm-generic/signal-defs.h>
  87. #ifdef SA_RESTORER
  88. #define __ARCH_HAS_SA_RESTORER
  89. #endif
  90. struct sigaction {
  91. __sighandler_t sa_handler;
  92. unsigned long sa_flags;
  93. #ifdef SA_RESTORER
  94. __sigrestore_t sa_restorer;
  95. #endif
  96. sigset_t sa_mask; /* mask last for extensibility */
  97. };
  98. typedef struct sigaltstack {
  99. void *ss_sp;
  100. int ss_flags;
  101. size_t ss_size;
  102. } stack_t;
  103. #endif /* __ASSEMBLY__ */
  104. #endif /* __ASM_GENERIC_SIGNAL_H */