signal.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #ifndef _UAPI_ASM_X86_SIGNAL_H
  2. #define _UAPI_ASM_X86_SIGNAL_H
  3. #ifndef __ASSEMBLY__
  4. #include <linux/types.h>
  5. #include <linux/time.h>
  6. #include <linux/compiler.h>
  7. /* Avoid too many header ordering problems. */
  8. struct siginfo;
  9. #ifndef __KERNEL__
  10. /* Here we must cater to libcs that poke about in kernel headers. */
  11. #define NSIG 32
  12. typedef unsigned long sigset_t;
  13. #endif /* __KERNEL__ */
  14. #endif /* __ASSEMBLY__ */
  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 SIGIOT 6
  22. #define SIGBUS 7
  23. #define SIGFPE 8
  24. #define SIGKILL 9
  25. #define SIGUSR1 10
  26. #define SIGSEGV 11
  27. #define SIGUSR2 12
  28. #define SIGPIPE 13
  29. #define SIGALRM 14
  30. #define SIGTERM 15
  31. #define SIGSTKFLT 16
  32. #define SIGCHLD 17
  33. #define SIGCONT 18
  34. #define SIGSTOP 19
  35. #define SIGTSTP 20
  36. #define SIGTTIN 21
  37. #define SIGTTOU 22
  38. #define SIGURG 23
  39. #define SIGXCPU 24
  40. #define SIGXFSZ 25
  41. #define SIGVTALRM 26
  42. #define SIGPROF 27
  43. #define SIGWINCH 28
  44. #define SIGIO 29
  45. #define SIGPOLL SIGIO
  46. /*
  47. #define SIGLOST 29
  48. */
  49. #define SIGPWR 30
  50. #define SIGSYS 31
  51. #define SIGUNUSED 31
  52. /* These should not be considered constants from userland. */
  53. #define SIGRTMIN 32
  54. #define SIGRTMAX _NSIG
  55. /*
  56. * SA_FLAGS values:
  57. *
  58. * SA_ONSTACK indicates that a registered stack_t will be used.
  59. * SA_RESTART flag to get restarting signals (which were the default long ago)
  60. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  61. * SA_RESETHAND clears the handler when the signal is delivered.
  62. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  63. * SA_NODEFER prevents the current signal from being masked in the handler.
  64. *
  65. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  66. * Unix names RESETHAND and NODEFER respectively.
  67. */
  68. #define SA_NOCLDSTOP 0x00000001u
  69. #define SA_NOCLDWAIT 0x00000002u
  70. #define SA_SIGINFO 0x00000004u
  71. #define SA_ONSTACK 0x08000000u
  72. #define SA_RESTART 0x10000000u
  73. #define SA_NODEFER 0x40000000u
  74. #define SA_RESETHAND 0x80000000u
  75. #define SA_NOMASK SA_NODEFER
  76. #define SA_ONESHOT SA_RESETHAND
  77. #define SA_RESTORER 0x04000000
  78. #define MINSIGSTKSZ 2048
  79. #define SIGSTKSZ 8192
  80. #include <asm-generic/signal-defs.h>
  81. #ifndef __ASSEMBLY__
  82. # ifndef __KERNEL__
  83. /* Here we must cater to libcs that poke about in kernel headers. */
  84. #ifdef __i386__
  85. struct sigaction {
  86. union {
  87. __sighandler_t _sa_handler;
  88. void (*_sa_sigaction)(int, struct siginfo *, void *);
  89. } _u;
  90. sigset_t sa_mask;
  91. unsigned long sa_flags;
  92. void (*sa_restorer)(void);
  93. };
  94. #define sa_handler _u._sa_handler
  95. #define sa_sigaction _u._sa_sigaction
  96. #else /* __i386__ */
  97. struct sigaction {
  98. __sighandler_t sa_handler;
  99. unsigned long sa_flags;
  100. __sigrestore_t sa_restorer;
  101. sigset_t sa_mask; /* mask last for extensibility */
  102. };
  103. #endif /* !__i386__ */
  104. # endif /* ! __KERNEL__ */
  105. typedef struct sigaltstack {
  106. void __user *ss_sp;
  107. int ss_flags;
  108. size_t ss_size;
  109. } stack_t;
  110. #endif /* __ASSEMBLY__ */
  111. #endif /* _UAPI_ASM_X86_SIGNAL_H */