2
0

signal.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  2. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4. #define MINSIGSTKSZ 4096
  5. #define SIGSTKSZ 10240
  6. #endif
  7. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  8. typedef unsigned long greg_t, gregset_t[48];
  9. typedef double fpregset_t[33];
  10. typedef struct {
  11. #ifdef __GNUC__
  12. __attribute__((__aligned__(16)))
  13. #endif
  14. unsigned vrregs[32][4];
  15. struct {
  16. #if __BIG_ENDIAN__
  17. unsigned _pad[3], vscr_word;
  18. #else
  19. unsigned vscr_word, _pad[3];
  20. #endif
  21. } vscr;
  22. unsigned vrsave, _pad[3];
  23. } vrregset_t;
  24. typedef struct sigcontext {
  25. unsigned long _unused[4];
  26. int signal;
  27. int _pad0;
  28. unsigned long handler;
  29. unsigned long oldmask;
  30. struct pt_regs *regs;
  31. gregset_t gp_regs;
  32. fpregset_t fp_regs;
  33. vrregset_t *v_regs;
  34. long vmx_reserve[34+34+32+1];
  35. } mcontext_t;
  36. #else
  37. typedef struct {
  38. long __regs[4+4+48+33+1+34+34+32+1];
  39. } mcontext_t;
  40. #endif
  41. struct sigaltstack {
  42. void *ss_sp;
  43. int ss_flags;
  44. size_t ss_size;
  45. };
  46. typedef struct __ucontext {
  47. unsigned long uc_flags;
  48. struct __ucontext *uc_link;
  49. stack_t uc_stack;
  50. sigset_t uc_sigmask;
  51. mcontext_t uc_mcontext;
  52. } ucontext_t;
  53. #define SA_NOCLDSTOP 1U
  54. #define SA_NOCLDWAIT 2U
  55. #define SA_SIGINFO 4U
  56. #define SA_ONSTACK 0x08000000U
  57. #define SA_RESTART 0x10000000U
  58. #define SA_NODEFER 0x40000000U
  59. #define SA_RESETHAND 0x80000000U
  60. #define SA_RESTORER 0x04000000U
  61. #endif
  62. #define SIGHUP 1
  63. #define SIGINT 2
  64. #define SIGQUIT 3
  65. #define SIGILL 4
  66. #define SIGTRAP 5
  67. #define SIGABRT 6
  68. #define SIGIOT SIGABRT
  69. #define SIGBUS 7
  70. #define SIGFPE 8
  71. #define SIGKILL 9
  72. #define SIGUSR1 10
  73. #define SIGSEGV 11
  74. #define SIGUSR2 12
  75. #define SIGPIPE 13
  76. #define SIGALRM 14
  77. #define SIGTERM 15
  78. #define SIGSTKFLT 16
  79. #define SIGCHLD 17
  80. #define SIGCONT 18
  81. #define SIGSTOP 19
  82. #define SIGTSTP 20
  83. #define SIGTTIN 21
  84. #define SIGTTOU 22
  85. #define SIGURG 23
  86. #define SIGXCPU 24
  87. #define SIGXFSZ 25
  88. #define SIGVTALRM 26
  89. #define SIGPROF 27
  90. #define SIGWINCH 28
  91. #define SIGIO 29
  92. #define SIGPOLL SIGIO
  93. #define SIGPWR 30
  94. #define SIGSYS 31
  95. #define SIGUNUSED SIGSYS
  96. #define _NSIG 65