kernel_sigaction.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _BITS_SIGACTION_STRUCT_H
  2. #define _BITS_SIGACTION_STRUCT_H
  3. /* This file provides whatever this particular arch's kernel thinks
  4. * the sigaction struct should look like... */
  5. #undef NO_OLD_SIGACTION
  6. #if defined(__mips__)
  7. /* We have libc/sysdeps/linux/mips/bits/kernel_sigaction.h,
  8. * so this should never be used. Lets see whether it is true. */
  9. struct BUG_is_here { char BUG_is_here[-1]; };
  10. #undef HAVE_SA_RESTORER
  11. /* This is the sigaction structure from the Linux 2.1.24 kernel. */
  12. #include <sgidefs.h>
  13. struct old_kernel_sigaction {
  14. __sighandler_t k_sa_handler;
  15. unsigned int sa_flags;
  16. unsigned long sa_mask;
  17. };
  18. #define _KERNEL_NSIG 128
  19. #define _KERNEL_NSIG_BPW 32
  20. #define _KERNEL_NSIG_WORDS (_KERNEL_NSIG / _KERNEL_NSIG_BPW)
  21. typedef struct {
  22. unsigned long sig[_KERNEL_NSIG_WORDS];
  23. } kernel_sigset_t;
  24. /* This is the sigaction structure from the Linux 2.1.68 kernel. */
  25. struct kernel_sigaction {
  26. unsigned int sa_flags;
  27. __sighandler_t k_sa_handler;
  28. kernel_sigset_t sa_mask;
  29. void (*sa_restorer)(void);
  30. int s_resv[1]; /* reserved */
  31. };
  32. #elif defined(__ia64__)
  33. #define NO_OLD_SIGACTION
  34. #undef HAVE_SA_RESTORER
  35. struct kernel_sigaction {
  36. __sighandler_t k_sa_handler;
  37. unsigned long sa_flags;
  38. sigset_t sa_mask;
  39. };
  40. #else
  41. #define HAVE_SA_RESTORER
  42. /* This is the sigaction structure from the Linux 2.1.20 kernel. */
  43. struct old_kernel_sigaction {
  44. __sighandler_t k_sa_handler;
  45. unsigned long sa_mask;
  46. unsigned long sa_flags;
  47. void (*sa_restorer) (void);
  48. };
  49. /* This is the sigaction structure from the Linux 2.1.68 kernel. */
  50. struct kernel_sigaction {
  51. __sighandler_t k_sa_handler;
  52. unsigned long sa_flags;
  53. void (*sa_restorer) (void);
  54. sigset_t sa_mask;
  55. };
  56. #endif
  57. #ifndef NO_OLD_SIGACTION
  58. extern int __syscall_sigaction (int, const struct old_kernel_sigaction *,
  59. struct old_kernel_sigaction *) attribute_hidden;
  60. #endif
  61. extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
  62. struct kernel_sigaction *, size_t) attribute_hidden;
  63. #endif /* _BITS_SIGACTION_STRUCT_H */