signal.h 3.3 KB

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