1
0

signal.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  2. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4. typedef unsigned long long greg_t, gregset_t[32];
  5. typedef struct {
  6. union {
  7. double fp_dregs[32];
  8. struct {
  9. float _fp_fregs;
  10. unsigned _fp_pad;
  11. } fp_fregs[32];
  12. } fp_r;
  13. } fpregset_t;
  14. struct sigcontext
  15. {
  16. unsigned sc_regmask, sc_status;
  17. unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
  18. unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
  19. unsigned long long sc_mdhi, sc_mdlo;
  20. unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
  21. };
  22. typedef struct
  23. {
  24. unsigned regmask, status;
  25. unsigned long long pc, regs[32], fpregs[32];
  26. unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
  27. unsigned long long mdhi, mdlo;
  28. unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
  29. } mcontext_t;
  30. #else
  31. typedef struct {
  32. unsigned __mc1[2];
  33. unsigned long long __mc2[65];
  34. unsigned __mc3[5];
  35. unsigned long long __mc4[2];
  36. unsigned __mc5[6];
  37. } mcontext_t;
  38. #endif
  39. typedef struct __ucontext {
  40. unsigned long uc_flags;
  41. struct __ucontext *uc_link;
  42. stack_t uc_stack;
  43. mcontext_t uc_mcontext;
  44. sigset_t uc_sigmask;
  45. unsigned long uc_regspace[128];
  46. } ucontext_t;
  47. #define SA_NOCLDSTOP 1
  48. #define SA_NOCLDWAIT 0x10000
  49. #define SA_SIGINFO 8
  50. #define SA_ONSTACK 0x08000000
  51. #define SA_RESTART 0x10000000
  52. #define SA_NODEFER 0x40000000
  53. #define SA_RESETHAND 0x80000000
  54. #define SA_RESTORER 0x04000000
  55. #undef SIG_BLOCK
  56. #undef SIG_UNBLOCK
  57. #undef SIG_SETMASK
  58. #define SIG_BLOCK 1
  59. #define SIG_UNBLOCK 2
  60. #define SIG_SETMASK 3
  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 SIGSTKFLT 7
  70. #define SIGFPE 8
  71. #define SIGKILL 9
  72. #define SIGBUS 10
  73. #define SIGSEGV 11
  74. #define SIGSYS 12
  75. #define SIGPIPE 13
  76. #define SIGALRM 14
  77. #define SIGTERM 15
  78. #define SIGUSR1 16
  79. #define SIGUSR2 17
  80. #define SIGCHLD 18
  81. #define SIGPWR 19
  82. #define SIGWINCH 20
  83. #define SIGURG 21
  84. #define SIGIO 22
  85. #define SIGPOLL SIGIO
  86. #define SIGSTOP 23
  87. #define SIGTSTP 24
  88. #define SIGCONT 25
  89. #define SIGTTIN 26
  90. #define SIGTTOU 27
  91. #define SIGVTALRM 28
  92. #define SIGPROF 29
  93. #define SIGXCPU 30
  94. #define SIGXFSZ 31
  95. #define SIGUNUSED SIGSYS
  96. #define _NSIG 129