2
0

signal.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 int greg_t, gregset_t[16];
  9. typedef int freg_t, fpregset_t[16];
  10. typedef struct {
  11. unsigned long oldmask;
  12. unsigned long gregs[16];
  13. unsigned long pc, pr, sr;
  14. unsigned long gbr, mach, macl;
  15. unsigned long fpregs[16];
  16. unsigned long xfpregs[16];
  17. unsigned int fpscr, fpul, ownedfp;
  18. } mcontext_t;
  19. struct sigcontext {
  20. unsigned long oldmask;
  21. unsigned long sc_regs[16];
  22. unsigned long sc_pc, sc_pr, sc_sr;
  23. unsigned long sc_gbr, sc_mach, sc_macl;
  24. unsigned long sc_fpregs[16];
  25. unsigned long sc_xfpregs[16];
  26. unsigned int sc_fpscr, sc_fpul, sc_ownedfp;
  27. };
  28. #else
  29. typedef struct {
  30. unsigned long __regs[58];
  31. } mcontext_t;
  32. #endif
  33. struct sigaltstack {
  34. void *ss_sp;
  35. int ss_flags;
  36. size_t ss_size;
  37. };
  38. typedef struct __ucontext {
  39. unsigned long uc_flags;
  40. struct __ucontext *uc_link;
  41. stack_t uc_stack;
  42. mcontext_t uc_mcontext;
  43. sigset_t uc_sigmask;
  44. } ucontext_t;
  45. #define SA_NOCLDSTOP 1
  46. #define SA_NOCLDWAIT 2
  47. #define SA_SIGINFO 4
  48. #define SA_ONSTACK 0x08000000
  49. #define SA_RESTART 0x10000000
  50. #define SA_NODEFER 0x40000000
  51. #define SA_RESETHAND 0x80000000
  52. #define SA_RESTORER 0x04000000
  53. #endif
  54. #define SIGHUP 1
  55. #define SIGINT 2
  56. #define SIGQUIT 3
  57. #define SIGILL 4
  58. #define SIGTRAP 5
  59. #define SIGABRT 6
  60. #define SIGIOT SIGABRT
  61. #define SIGBUS 7
  62. #define SIGFPE 8
  63. #define SIGKILL 9
  64. #define SIGUSR1 10
  65. #define SIGSEGV 11
  66. #define SIGUSR2 12
  67. #define SIGPIPE 13
  68. #define SIGALRM 14
  69. #define SIGTERM 15
  70. #define SIGSTKFLT 16
  71. #define SIGCHLD 17
  72. #define SIGCONT 18
  73. #define SIGSTOP 19
  74. #define SIGTSTP 20
  75. #define SIGTTIN 21
  76. #define SIGTTOU 22
  77. #define SIGURG 23
  78. #define SIGXCPU 24
  79. #define SIGXFSZ 25
  80. #define SIGVTALRM 26
  81. #define SIGPROF 27
  82. #define SIGWINCH 28
  83. #define SIGIO 29
  84. #define SIGPOLL 29
  85. #define SIGPWR 30
  86. #define SIGSYS 31
  87. #define SIGUNUSED SIGSYS
  88. #define _NSIG 65