signal.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * S390 version
  3. *
  4. * Derived from "include/asm-i386/signal.h"
  5. */
  6. #ifndef _ASMS390_SIGNAL_H
  7. #define _ASMS390_SIGNAL_H
  8. #include <linux/types.h>
  9. #include <linux/time.h>
  10. /* Avoid too many header ordering problems. */
  11. struct siginfo;
  12. struct pt_regs;
  13. #ifdef __KERNEL__
  14. /* Most things should be clean enough to redefine this at will, if care
  15. is taken to make libc match. */
  16. #include <asm/sigcontext.h>
  17. #define _NSIG _SIGCONTEXT_NSIG
  18. #define _NSIG_BPW _SIGCONTEXT_NSIG_BPW
  19. #define _NSIG_WORDS _SIGCONTEXT_NSIG_WORDS
  20. typedef unsigned long old_sigset_t; /* at least 32 bits */
  21. typedef struct {
  22. unsigned long sig[_NSIG_WORDS];
  23. } sigset_t;
  24. #else
  25. /* Here we must cater to libcs that poke about in kernel headers. */
  26. #define NSIG 32
  27. typedef unsigned long sigset_t;
  28. #endif /* __KERNEL__ */
  29. #define SIGHUP 1
  30. #define SIGINT 2
  31. #define SIGQUIT 3
  32. #define SIGILL 4
  33. #define SIGTRAP 5
  34. #define SIGABRT 6
  35. #define SIGIOT 6
  36. #define SIGBUS 7
  37. #define SIGFPE 8
  38. #define SIGKILL 9
  39. #define SIGUSR1 10
  40. #define SIGSEGV 11
  41. #define SIGUSR2 12
  42. #define SIGPIPE 13
  43. #define SIGALRM 14
  44. #define SIGTERM 15
  45. #define SIGSTKFLT 16
  46. #define SIGCHLD 17
  47. #define SIGCONT 18
  48. #define SIGSTOP 19
  49. #define SIGTSTP 20
  50. #define SIGTTIN 21
  51. #define SIGTTOU 22
  52. #define SIGURG 23
  53. #define SIGXCPU 24
  54. #define SIGXFSZ 25
  55. #define SIGVTALRM 26
  56. #define SIGPROF 27
  57. #define SIGWINCH 28
  58. #define SIGIO 29
  59. #define SIGPOLL SIGIO
  60. /*
  61. #define SIGLOST 29
  62. */
  63. #define SIGPWR 30
  64. #define SIGSYS 31
  65. #define SIGUNUSED 31
  66. /* These should not be considered constants from userland. */
  67. #define SIGRTMIN 32
  68. #define SIGRTMAX _NSIG
  69. /*
  70. * SA_FLAGS values:
  71. *
  72. * SA_ONSTACK indicates that a registered stack_t will be used.
  73. * SA_RESTART flag to get restarting signals (which were the default long ago)
  74. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  75. * SA_RESETHAND clears the handler when the signal is delivered.
  76. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  77. * SA_NODEFER prevents the current signal from being masked in the handler.
  78. *
  79. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  80. * Unix names RESETHAND and NODEFER respectively.
  81. */
  82. #define SA_NOCLDSTOP 0x00000001
  83. #define SA_NOCLDWAIT 0x00000002
  84. #define SA_SIGINFO 0x00000004
  85. #define SA_ONSTACK 0x08000000
  86. #define SA_RESTART 0x10000000
  87. #define SA_NODEFER 0x40000000
  88. #define SA_RESETHAND 0x80000000
  89. #define SA_NOMASK SA_NODEFER
  90. #define SA_ONESHOT SA_RESETHAND
  91. #define SA_RESTORER 0x04000000
  92. /*
  93. * sigaltstack controls
  94. */
  95. #define SS_ONSTACK 1
  96. #define SS_DISABLE 2
  97. #define MINSIGSTKSZ 2048
  98. #define SIGSTKSZ 8192
  99. #include <asm-generic/signal-defs.h>
  100. #ifdef __KERNEL__
  101. struct old_sigaction {
  102. __sighandler_t sa_handler;
  103. old_sigset_t sa_mask;
  104. unsigned long sa_flags;
  105. void (*sa_restorer)(void);
  106. };
  107. struct sigaction {
  108. __sighandler_t sa_handler;
  109. unsigned long sa_flags;
  110. void (*sa_restorer)(void);
  111. sigset_t sa_mask; /* mask last for extensibility */
  112. };
  113. struct k_sigaction {
  114. struct sigaction sa;
  115. };
  116. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  117. #else
  118. /* Here we must cater to libcs that poke about in kernel headers. */
  119. struct sigaction {
  120. union {
  121. __sighandler_t _sa_handler;
  122. void (*_sa_sigaction)(int, struct siginfo *, void *);
  123. } _u;
  124. #ifndef __s390x__ /* lovely */
  125. sigset_t sa_mask;
  126. unsigned long sa_flags;
  127. void (*sa_restorer)(void);
  128. #else /* __s390x__ */
  129. unsigned long sa_flags;
  130. void (*sa_restorer)(void);
  131. sigset_t sa_mask;
  132. #endif /* __s390x__ */
  133. };
  134. #define sa_handler _u._sa_handler
  135. #define sa_sigaction _u._sa_sigaction
  136. #endif /* __KERNEL__ */
  137. typedef struct sigaltstack {
  138. void __user *ss_sp;
  139. int ss_flags;
  140. size_t ss_size;
  141. } stack_t;
  142. #endif