1
0

signal.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 2048
  5. #define SIGSTKSZ 8192
  6. #endif
  7. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  8. typedef unsigned long long greg_t, gregset_t[32];
  9. typedef struct {
  10. union {
  11. double fp_dregs[32];
  12. struct {
  13. float _fp_fregs;
  14. unsigned _fp_pad;
  15. } fp_fregs[32];
  16. } fp_r;
  17. } fpregset_t;
  18. struct sigcontext {
  19. unsigned sc_regmask, sc_status;
  20. unsigned long long sc_pc;
  21. gregset_t sc_regs;
  22. fpregset_t sc_fpregs;
  23. unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
  24. unsigned long long sc_mdhi, sc_mdlo;
  25. unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
  26. };
  27. typedef struct {
  28. unsigned regmask, status;
  29. unsigned long long pc;
  30. gregset_t gregs;
  31. fpregset_t fpregs;
  32. unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
  33. unsigned long long mdhi, mdlo;
  34. unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
  35. } mcontext_t;
  36. #else
  37. typedef struct {
  38. unsigned __mc1[2];
  39. unsigned long long __mc2[65];
  40. unsigned __mc3[5];
  41. unsigned long long __mc4[2];
  42. unsigned __mc5[6];
  43. } mcontext_t;
  44. #endif
  45. struct sigaltstack {
  46. void *ss_sp;
  47. size_t ss_size;
  48. int ss_flags;
  49. };
  50. typedef struct __ucontext {
  51. unsigned long uc_flags;
  52. struct __ucontext *uc_link;
  53. stack_t uc_stack;
  54. mcontext_t uc_mcontext;
  55. sigset_t uc_sigmask;
  56. } ucontext_t;
  57. #define SA_NOCLDSTOP 1
  58. #define SA_NOCLDWAIT 0x10000
  59. #define SA_SIGINFO 8
  60. #define SA_ONSTACK 0x08000000
  61. #define SA_RESTART 0x10000000
  62. #define SA_NODEFER 0x40000000
  63. #define SA_RESETHAND 0x80000000
  64. #undef SIG_BLOCK
  65. #undef SIG_UNBLOCK
  66. #undef SIG_SETMASK
  67. #define SIG_BLOCK 1
  68. #define SIG_UNBLOCK 2
  69. #define SIG_SETMASK 3
  70. #undef SI_ASYNCIO
  71. #undef SI_MESGQ
  72. #undef SI_TIMER
  73. #define SI_ASYNCIO (-2)
  74. #define SI_MESGQ (-4)
  75. #define SI_TIMER (-3)
  76. #define __SI_SWAP_ERRNO_CODE
  77. #endif
  78. #define SIGHUP 1
  79. #define SIGINT 2
  80. #define SIGQUIT 3
  81. #define SIGILL 4
  82. #define SIGTRAP 5
  83. #define SIGABRT 6
  84. #define SIGIOT SIGABRT
  85. #define SIGEMT 7
  86. #define SIGFPE 8
  87. #define SIGKILL 9
  88. #define SIGBUS 10
  89. #define SIGSEGV 11
  90. #define SIGSYS 12
  91. #define SIGPIPE 13
  92. #define SIGALRM 14
  93. #define SIGTERM 15
  94. #define SIGUSR1 16
  95. #define SIGUSR2 17
  96. #define SIGCHLD 18
  97. #define SIGPWR 19
  98. #define SIGWINCH 20
  99. #define SIGURG 21
  100. #define SIGIO 22
  101. #define SIGPOLL SIGIO
  102. #define SIGSTOP 23
  103. #define SIGTSTP 24
  104. #define SIGCONT 25
  105. #define SIGTTIN 26
  106. #define SIGTTOU 27
  107. #define SIGVTALRM 28
  108. #define SIGPROF 29
  109. #define SIGXCPU 30
  110. #define SIGXFSZ 31
  111. #define SIGUNUSED SIGSYS
  112. #define _NSIG 128