signal.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #ifndef _UAPI__ASM_GENERIC_SIGNAL_H
  2. #define _UAPI__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. #if !defined MINSIGSTKSZ || !defined SIGSTKSZ
  76. #define MINSIGSTKSZ 2048
  77. #define SIGSTKSZ 8192
  78. #endif
  79. #ifndef __ASSEMBLY__
  80. typedef struct {
  81. unsigned long sig[_NSIG_WORDS];
  82. } sigset_t;
  83. /* not actually used, but required for linux/syscalls.h */
  84. typedef unsigned long old_sigset_t;
  85. #include <asm-generic/signal-defs.h>
  86. #ifdef SA_RESTORER
  87. #define __ARCH_HAS_SA_RESTORER
  88. #endif
  89. #ifndef __KERNEL__
  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. #endif
  99. typedef struct sigaltstack {
  100. void __user *ss_sp;
  101. int ss_flags;
  102. size_t ss_size;
  103. } stack_t;
  104. #endif /* __ASSEMBLY__ */
  105. #endif /* _UAPI__ASM_GENERIC_SIGNAL_H */