kernel_sigaction.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef _BITS_STAT_STRUCT_H
  2. #define _BITS_STAT_STRUCT_H
  3. /* This file provides whatever this particular arch's kernel thinks
  4. * the sigaction struct should look like... */
  5. #if defined(__alpha__)
  6. #undef HAVE_SA_RESTORER
  7. /* This is the sigaction struction from the Linux 2.1.20 kernel. */
  8. struct old_kernel_sigaction {
  9. __sighandler_t k_sa_handler;
  10. unsigned long sa_mask;
  11. unsigned int sa_flags;
  12. };
  13. /* This is the sigaction structure from the Linux 2.1.68 kernel. */
  14. struct kernel_sigaction {
  15. __sighandler_t k_sa_handler;
  16. unsigned int sa_flags;
  17. sigset_t sa_mask;
  18. };
  19. #elif defined(__hppa__)
  20. #undef HAVE_SA_RESTORER
  21. /* This is the sigaction struction from the Linux 2.1.20 kernel. */
  22. /* Blah. This is bogus. We don't ever use it. */
  23. struct old_kernel_sigaction {
  24. __sighandler_t k_sa_handler;
  25. unsigned long sa_mask;
  26. unsigned long sa_flags;
  27. };
  28. /* This is the sigaction structure from the Linux 2.1.68 kernel. */
  29. struct kernel_sigaction {
  30. __sighandler_t k_sa_handler;
  31. unsigned long sa_flags;
  32. sigset_t sa_mask;
  33. };
  34. #elif defined(__mips__)
  35. #define HAVE_SA_RESTORER
  36. /* This is the sigaction structure from the Linux 2.1.24 kernel. */
  37. #include <sgidefs.h>
  38. struct old_kernel_sigaction {
  39. unsigned int sa_flags;
  40. __sighandler_t k_sa_handler;
  41. unsigned long sa_mask;
  42. unsigned int __pad0[3]; /* reserved, keep size constant */
  43. /* Abi says here follows reserved int[2] */
  44. void (*sa_restorer)(void);
  45. #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2)
  46. /* For 32 bit code we have to pad struct sigaction to get
  47. * constant size for the ABI */
  48. int pad1[1]; /* reserved */
  49. #endif
  50. };
  51. #define _KERNEL_NSIG 128
  52. #define _KERNEL_NSIG_BPW 32
  53. #define _KERNEL_NSIG_WORDS (_KERNEL_NSIG / _KERNEL_NSIG_BPW)
  54. typedef struct {
  55. unsigned long sig[_KERNEL_NSIG_WORDS];
  56. } kernel_sigset_t;
  57. /* This is the sigaction structure from the Linux 2.1.68 kernel. */
  58. struct kernel_sigaction {
  59. unsigned int sa_flags;
  60. __sighandler_t k_sa_handler;
  61. kernel_sigset_t sa_mask;
  62. void (*sa_restorer)(void);
  63. int s_resv[1]; /* reserved */
  64. };
  65. #else
  66. #define HAVE_SA_RESTORER
  67. /* This is the sigaction structure from the Linux 2.1.20 kernel. */
  68. struct old_kernel_sigaction {
  69. __sighandler_t k_sa_handler;
  70. unsigned long sa_mask;
  71. unsigned long sa_flags;
  72. void (*sa_restorer) (void);
  73. };
  74. /* This is the sigaction structure from the Linux 2.1.68 kernel. */
  75. struct kernel_sigaction {
  76. __sighandler_t k_sa_handler;
  77. unsigned long sa_flags;
  78. void (*sa_restorer) (void);
  79. sigset_t sa_mask;
  80. };
  81. #endif
  82. extern int __syscall_sigaction (int, const struct old_kernel_sigaction *__unbounded,
  83. struct old_kernel_sigaction *__unbounded);
  84. extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded,
  85. struct kernel_sigaction *__unbounded, size_t);
  86. #endif /* _BITS_STAT_STRUCT_H */