signal.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #ifndef _UAPI_ASMAXP_SIGNAL_H
  2. #define _UAPI_ASMAXP_SIGNAL_H
  3. #include <linux/types.h>
  4. /* Avoid too many header ordering problems. */
  5. struct siginfo;
  6. #ifndef __KERNEL__
  7. /* Here we must cater to libcs that poke about in kernel headers. */
  8. #define NSIG 32
  9. typedef unsigned long sigset_t;
  10. #endif /* __KERNEL__ */
  11. /*
  12. * Linux/AXP has different signal numbers that Linux/i386: I'm trying
  13. * to make it OSF/1 binary compatible, at least for normal binaries.
  14. */
  15. #define SIGHUP 1
  16. #define SIGINT 2
  17. #define SIGQUIT 3
  18. #define SIGILL 4
  19. #define SIGTRAP 5
  20. #define SIGABRT 6
  21. #define SIGEMT 7
  22. #define SIGFPE 8
  23. #define SIGKILL 9
  24. #define SIGBUS 10
  25. #define SIGSEGV 11
  26. #define SIGSYS 12
  27. #define SIGPIPE 13
  28. #define SIGALRM 14
  29. #define SIGTERM 15
  30. #define SIGURG 16
  31. #define SIGSTOP 17
  32. #define SIGTSTP 18
  33. #define SIGCONT 19
  34. #define SIGCHLD 20
  35. #define SIGTTIN 21
  36. #define SIGTTOU 22
  37. #define SIGIO 23
  38. #define SIGXCPU 24
  39. #define SIGXFSZ 25
  40. #define SIGVTALRM 26
  41. #define SIGPROF 27
  42. #define SIGWINCH 28
  43. #define SIGINFO 29
  44. #define SIGUSR1 30
  45. #define SIGUSR2 31
  46. #define SIGPOLL SIGIO
  47. #define SIGPWR SIGINFO
  48. #define SIGIOT SIGABRT
  49. /* These should not be considered constants from userland. */
  50. #define SIGRTMIN 32
  51. #define SIGRTMAX _NSIG
  52. /*
  53. * SA_FLAGS values:
  54. *
  55. * SA_ONSTACK indicates that a registered stack_t will be used.
  56. * SA_RESTART flag to get restarting signals (which were the default long ago)
  57. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  58. * SA_RESETHAND clears the handler when the signal is delivered.
  59. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  60. * SA_NODEFER prevents the current signal from being masked in the handler.
  61. *
  62. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  63. * Unix names RESETHAND and NODEFER respectively.
  64. */
  65. #define SA_ONSTACK 0x00000001
  66. #define SA_RESTART 0x00000002
  67. #define SA_NOCLDSTOP 0x00000004
  68. #define SA_NODEFER 0x00000008
  69. #define SA_RESETHAND 0x00000010
  70. #define SA_NOCLDWAIT 0x00000020
  71. #define SA_SIGINFO 0x00000040
  72. #define SA_ONESHOT SA_RESETHAND
  73. #define SA_NOMASK SA_NODEFER
  74. #define MINSIGSTKSZ 4096
  75. #define SIGSTKSZ 16384
  76. #define SIG_BLOCK 1 /* for blocking signals */
  77. #define SIG_UNBLOCK 2 /* for unblocking signals */
  78. #define SIG_SETMASK 3 /* for setting the signal mask */
  79. #include <asm-generic/signal-defs.h>
  80. #ifndef __KERNEL__
  81. /* Here we must cater to libcs that poke about in kernel headers. */
  82. struct sigaction {
  83. union {
  84. __sighandler_t _sa_handler;
  85. void (*_sa_sigaction)(int, struct siginfo *, void *);
  86. } _u;
  87. sigset_t sa_mask;
  88. int sa_flags;
  89. };
  90. #define sa_handler _u._sa_handler
  91. #define sa_sigaction _u._sa_sigaction
  92. #endif /* __KERNEL__ */
  93. typedef struct sigaltstack {
  94. void __user *ss_sp;
  95. int ss_flags;
  96. size_t ss_size;
  97. } stack_t;
  98. /* sigstack(2) is deprecated, and will be withdrawn in a future version
  99. of the X/Open CAE Specification. Use sigaltstack instead. It is only
  100. implemented here for OSF/1 compatibility. */
  101. struct sigstack {
  102. void __user *ss_sp;
  103. int ss_onstack;
  104. };
  105. #endif /* _UAPI_ASMAXP_SIGNAL_H */