signal-defs.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __ASM_GENERIC_SIGNAL_DEFS_H
  3. #define __ASM_GENERIC_SIGNAL_DEFS_H
  4. /*
  5. * SA_FLAGS values:
  6. *
  7. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  8. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  9. * SA_SIGINFO delivers the signal with SIGINFO structs.
  10. * SA_ONSTACK indicates that a registered stack_t will be used.
  11. * SA_RESTART flag to get restarting signals (which were the default long ago)
  12. * SA_NODEFER prevents the current signal from being masked in the handler.
  13. * SA_RESETHAND clears the handler when the signal is delivered.
  14. * SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from
  15. * before the introduction of SA_UNSUPPORTED did not clear unknown bits from
  16. * sa_flags when read using the oldact argument to sigaction and rt_sigaction,
  17. * so this bit allows flag bit support to be detected from userspace while
  18. * allowing an old kernel to be distinguished from a kernel that supports every
  19. * flag bit.
  20. * SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in
  21. * siginfo.si_addr.
  22. *
  23. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  24. * Unix names RESETHAND and NODEFER respectively.
  25. */
  26. #ifndef SA_NOCLDSTOP
  27. #define SA_NOCLDSTOP 0x00000001
  28. #endif
  29. #ifndef SA_NOCLDWAIT
  30. #define SA_NOCLDWAIT 0x00000002
  31. #endif
  32. #ifndef SA_SIGINFO
  33. #define SA_SIGINFO 0x00000004
  34. #endif
  35. /* 0x00000008 used on alpha, mips, parisc */
  36. /* 0x00000010 used on alpha, parisc */
  37. /* 0x00000020 used on alpha, parisc, sparc */
  38. /* 0x00000040 used on alpha, parisc */
  39. /* 0x00000080 used on parisc */
  40. /* 0x00000100 used on sparc */
  41. /* 0x00000200 used on sparc */
  42. #define SA_UNSUPPORTED 0x00000400
  43. #define SA_EXPOSE_TAGBITS 0x00000800
  44. /* 0x00010000 used on mips */
  45. /* 0x00800000 used for internal SA_IMMUTABLE */
  46. /* 0x01000000 used on x86 */
  47. /* 0x02000000 used on x86 */
  48. /*
  49. * New architectures should not define the obsolete
  50. * SA_RESTORER 0x04000000
  51. */
  52. #ifndef SA_ONSTACK
  53. #define SA_ONSTACK 0x08000000
  54. #endif
  55. #ifndef SA_RESTART
  56. #define SA_RESTART 0x10000000
  57. #endif
  58. #ifndef SA_NODEFER
  59. #define SA_NODEFER 0x40000000
  60. #endif
  61. #ifndef SA_RESETHAND
  62. #define SA_RESETHAND 0x80000000
  63. #endif
  64. #define SA_NOMASK SA_NODEFER
  65. #define SA_ONESHOT SA_RESETHAND
  66. #ifndef SIG_BLOCK
  67. #define SIG_BLOCK 0 /* for blocking signals */
  68. #endif
  69. #ifndef SIG_UNBLOCK
  70. #define SIG_UNBLOCK 1 /* for unblocking signals */
  71. #endif
  72. #ifndef SIG_SETMASK
  73. #define SIG_SETMASK 2 /* for setting the signal mask */
  74. #endif
  75. #ifndef __ASSEMBLY__
  76. typedef void __signalfn_t(int);
  77. typedef __signalfn_t *__sighandler_t;
  78. typedef void __restorefn_t(void);
  79. typedef __restorefn_t *__sigrestore_t;
  80. #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
  81. #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
  82. #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
  83. #endif
  84. #endif /* __ASM_GENERIC_SIGNAL_DEFS_H */