signal.h 2.8 KB

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