signal.h 2.2 KB

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