signal.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. /*
  87. * There are two system calls in regard to sigaction, sys_rt_sigaction
  88. * and sys_sigaction. Internally the kernel uses the struct old_sigaction
  89. * for the older sys_sigaction system call, and the kernel version of the
  90. * struct sigaction for the newer sys_rt_sigaction.
  91. *
  92. * The uapi definition for struct sigaction has made a strange distinction
  93. * between 31-bit and 64-bit in the past. For 64-bit the uapi structure
  94. * looks like the kernel struct sigaction, but for 31-bit it used to
  95. * look like the kernel struct old_sigaction. That practically made the
  96. * structure unusable for either system call. To get around this problem
  97. * the glibc always had its own definitions for the sigaction structures.
  98. *
  99. * The current struct sigaction uapi definition below is suitable for the
  100. * sys_rt_sigaction system call only.
  101. */
  102. struct sigaction {
  103. union {
  104. __sighandler_t _sa_handler;
  105. void (*_sa_sigaction)(int, struct siginfo *, void *);
  106. } _u;
  107. unsigned long sa_flags;
  108. void (*sa_restorer)(void);
  109. sigset_t sa_mask;
  110. };
  111. #define sa_handler _u._sa_handler
  112. #define sa_sigaction _u._sa_sigaction
  113. #endif /* __KERNEL__ */
  114. typedef struct sigaltstack {
  115. void __user *ss_sp;
  116. int ss_flags;
  117. size_t ss_size;
  118. } stack_t;
  119. #endif /* _UAPI_ASMS390_SIGNAL_H */