signal.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_ASMAXP_SIGNAL_H
  3. #define _UAPI_ASMAXP_SIGNAL_H
  4. #include <linux/types.h>
  5. /* Avoid too many header ordering problems. */
  6. struct siginfo;
  7. #ifndef __KERNEL__
  8. /* Here we must cater to libcs that poke about in kernel headers. */
  9. #define NSIG 32
  10. typedef unsigned long sigset_t;
  11. #endif /* __KERNEL__ */
  12. /*
  13. * Linux/AXP has different signal numbers that Linux/i386: I'm trying
  14. * to make it OSF/1 binary compatible, at least for normal binaries.
  15. */
  16. #define SIGHUP 1
  17. #define SIGINT 2
  18. #define SIGQUIT 3
  19. #define SIGILL 4
  20. #define SIGTRAP 5
  21. #define SIGABRT 6
  22. #define SIGEMT 7
  23. #define SIGFPE 8
  24. #define SIGKILL 9
  25. #define SIGBUS 10
  26. #define SIGSEGV 11
  27. #define SIGSYS 12
  28. #define SIGPIPE 13
  29. #define SIGALRM 14
  30. #define SIGTERM 15
  31. #define SIGURG 16
  32. #define SIGSTOP 17
  33. #define SIGTSTP 18
  34. #define SIGCONT 19
  35. #define SIGCHLD 20
  36. #define SIGTTIN 21
  37. #define SIGTTOU 22
  38. #define SIGIO 23
  39. #define SIGXCPU 24
  40. #define SIGXFSZ 25
  41. #define SIGVTALRM 26
  42. #define SIGPROF 27
  43. #define SIGWINCH 28
  44. #define SIGINFO 29
  45. #define SIGUSR1 30
  46. #define SIGUSR2 31
  47. #define SIGPOLL SIGIO
  48. #define SIGPWR SIGINFO
  49. #define SIGIOT SIGABRT
  50. /* These should not be considered constants from userland. */
  51. #define SIGRTMIN 32
  52. #define SIGRTMAX _NSIG
  53. /*
  54. * SA_FLAGS values:
  55. *
  56. * SA_ONSTACK indicates that a registered stack_t will be used.
  57. * SA_RESTART flag to get restarting signals (which were the default long ago)
  58. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  59. * SA_RESETHAND clears the handler when the signal is delivered.
  60. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  61. * SA_NODEFER prevents the current signal from being masked in the handler.
  62. *
  63. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  64. * Unix names RESETHAND and NODEFER respectively.
  65. */
  66. #define SA_ONSTACK 0x00000001
  67. #define SA_RESTART 0x00000002
  68. #define SA_NOCLDSTOP 0x00000004
  69. #define SA_NODEFER 0x00000008
  70. #define SA_RESETHAND 0x00000010
  71. #define SA_NOCLDWAIT 0x00000020
  72. #define SA_SIGINFO 0x00000040
  73. #define SA_ONESHOT SA_RESETHAND
  74. #define SA_NOMASK SA_NODEFER
  75. #define MINSIGSTKSZ 4096
  76. #define SIGSTKSZ 16384
  77. #define SIG_BLOCK 1 /* for blocking signals */
  78. #define SIG_UNBLOCK 2 /* for unblocking signals */
  79. #define SIG_SETMASK 3 /* for setting the signal mask */
  80. #include <asm-generic/signal-defs.h>
  81. #ifndef __KERNEL__
  82. /* Here we must cater to libcs that poke about in kernel headers. */
  83. struct sigaction {
  84. union {
  85. __sighandler_t _sa_handler;
  86. void (*_sa_sigaction)(int, struct siginfo *, void *);
  87. } _u;
  88. sigset_t sa_mask;
  89. int sa_flags;
  90. };
  91. #define sa_handler _u._sa_handler
  92. #define sa_sigaction _u._sa_sigaction
  93. #endif /* __KERNEL__ */
  94. typedef struct sigaltstack {
  95. void __user *ss_sp;
  96. int ss_flags;
  97. size_t ss_size;
  98. } stack_t;
  99. /* sigstack(2) is deprecated, and will be withdrawn in a future version
  100. of the X/Open CAE Specification. Use sigaltstack instead. It is only
  101. implemented here for OSF/1 compatibility. */
  102. struct sigstack {
  103. void __user *ss_sp;
  104. int ss_onstack;
  105. };
  106. #endif /* _UAPI_ASMAXP_SIGNAL_H */