signal.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_ASM_X86_SIGNAL_H
  3. #define _UAPI_ASM_X86_SIGNAL_H
  4. #ifndef __ASSEMBLY__
  5. #include <linux/types.h>
  6. #include <linux/time.h>
  7. #include <linux/compiler.h>
  8. /* Avoid too many header ordering problems. */
  9. struct siginfo;
  10. #ifndef __KERNEL__
  11. /* Here we must cater to libcs that poke about in kernel headers. */
  12. #define NSIG 32
  13. typedef unsigned long sigset_t;
  14. #endif /* __KERNEL__ */
  15. #endif /* __ASSEMBLY__ */
  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 SIGIOT 6
  23. #define SIGBUS 7
  24. #define SIGFPE 8
  25. #define SIGKILL 9
  26. #define SIGUSR1 10
  27. #define SIGSEGV 11
  28. #define SIGUSR2 12
  29. #define SIGPIPE 13
  30. #define SIGALRM 14
  31. #define SIGTERM 15
  32. #define SIGSTKFLT 16
  33. #define SIGCHLD 17
  34. #define SIGCONT 18
  35. #define SIGSTOP 19
  36. #define SIGTSTP 20
  37. #define SIGTTIN 21
  38. #define SIGTTOU 22
  39. #define SIGURG 23
  40. #define SIGXCPU 24
  41. #define SIGXFSZ 25
  42. #define SIGVTALRM 26
  43. #define SIGPROF 27
  44. #define SIGWINCH 28
  45. #define SIGIO 29
  46. #define SIGPOLL SIGIO
  47. /*
  48. #define SIGLOST 29
  49. */
  50. #define SIGPWR 30
  51. #define SIGSYS 31
  52. #define SIGUNUSED 31
  53. /* These should not be considered constants from userland. */
  54. #define SIGRTMIN 32
  55. #define SIGRTMAX _NSIG
  56. /*
  57. * SA_FLAGS values:
  58. *
  59. * SA_ONSTACK indicates that a registered stack_t will be used.
  60. * SA_RESTART flag to get restarting signals (which were the default long ago)
  61. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  62. * SA_RESETHAND clears the handler when the signal is delivered.
  63. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  64. * SA_NODEFER prevents the current signal from being masked in the handler.
  65. *
  66. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  67. * Unix names RESETHAND and NODEFER respectively.
  68. */
  69. #define SA_NOCLDSTOP 0x00000001u
  70. #define SA_NOCLDWAIT 0x00000002u
  71. #define SA_SIGINFO 0x00000004u
  72. #define SA_ONSTACK 0x08000000u
  73. #define SA_RESTART 0x10000000u
  74. #define SA_NODEFER 0x40000000u
  75. #define SA_RESETHAND 0x80000000u
  76. #define SA_NOMASK SA_NODEFER
  77. #define SA_ONESHOT SA_RESETHAND
  78. #define SA_RESTORER 0x04000000
  79. #define MINSIGSTKSZ 2048
  80. #define SIGSTKSZ 8192
  81. #include <asm-generic/signal-defs.h>
  82. #ifndef __ASSEMBLY__
  83. # ifndef __KERNEL__
  84. /* Here we must cater to libcs that poke about in kernel headers. */
  85. #ifdef __i386__
  86. struct sigaction {
  87. union {
  88. __sighandler_t _sa_handler;
  89. void (*_sa_sigaction)(int, struct siginfo *, void *);
  90. } _u;
  91. sigset_t sa_mask;
  92. unsigned long sa_flags;
  93. void (*sa_restorer)(void);
  94. };
  95. #define sa_handler _u._sa_handler
  96. #define sa_sigaction _u._sa_sigaction
  97. #else /* __i386__ */
  98. struct sigaction {
  99. __sighandler_t sa_handler;
  100. unsigned long sa_flags;
  101. __sigrestore_t sa_restorer;
  102. sigset_t sa_mask; /* mask last for extensibility */
  103. };
  104. #endif /* !__i386__ */
  105. # endif /* ! __KERNEL__ */
  106. typedef struct sigaltstack {
  107. void __user *ss_sp;
  108. int ss_flags;
  109. size_t ss_size;
  110. } stack_t;
  111. #endif /* __ASSEMBLY__ */
  112. #endif /* _UAPI_ASM_X86_SIGNAL_H */