1
0

signal.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  2. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  3. struct __fpstate {
  4. unsigned long __x[7];
  5. unsigned char __y[80];
  6. unsigned long __z;
  7. };
  8. typedef struct {
  9. unsigned long __gregs[19];
  10. void *__fpregs;
  11. unsigned long __oldmask, __cr2;
  12. } mcontext_t;
  13. typedef struct __ucontext {
  14. unsigned long uc_flags;
  15. struct __ucontext *uc_link;
  16. stack_t uc_stack;
  17. mcontext_t uc_mcontext;
  18. sigset_t uc_sigmask;
  19. struct __fpstate __fpregs_mem;
  20. } ucontext_t;
  21. #ifdef _GNU_SOURCE
  22. struct sigcontext {
  23. unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
  24. unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
  25. unsigned long trapno, err, eip;
  26. unsigned short cs, __csh;
  27. unsigned long eflags, esp_at_signal;
  28. unsigned short ss, __ssh;
  29. struct __fpstate *fpstate;
  30. unsigned long oldmask, cr2;
  31. };
  32. #endif
  33. struct __siginfo
  34. {
  35. int si_signo;
  36. int si_errno;
  37. int si_code;
  38. union
  39. {
  40. char __pad[128 - 3*sizeof(int)];
  41. struct {
  42. pid_t si_pid;
  43. uid_t si_uid;
  44. union sigval si_sigval;
  45. } __rt;
  46. struct {
  47. unsigned int si_timer1;
  48. unsigned int si_timer2;
  49. } __timer;
  50. struct {
  51. pid_t si_pid;
  52. uid_t si_uid;
  53. int si_status;
  54. clock_t si_utime;
  55. clock_t si_stime;
  56. } __sigchld;
  57. struct {
  58. void *si_addr;
  59. } __sigfault;
  60. struct {
  61. long int si_band;
  62. int si_fd;
  63. } __sigpoll;
  64. } __si_fields;
  65. };
  66. #define si_pid __si_fields.__sigchld.si_pid
  67. #define si_uid __si_fields.__sigchld.si_uid
  68. #define si_status __si_fields.__sigchld.si_status
  69. #define si_utime __si_fields.__sigchld.si_utime
  70. #define si_stime __si_fields.__sigchld.si_stime
  71. #define si_value __si_fields.__rt.si_sigval
  72. #define si_addr __si_fields.__sigfault.si_addr
  73. #define si_band __si_fields.__sigpoll.si_band
  74. #define SI_ASYNCNL (-60)
  75. #define SI_TKILL (-6)
  76. #define SI_SIGIO (-5)
  77. #define SI_ASYNCIO (-4)
  78. #define SI_MESGQ (-3)
  79. #define SI_TIMER (-2)
  80. #define SI_QUEUE (-1)
  81. #define SI_USER 0
  82. #define SI_KERNEL 128
  83. #define FPE_INTDIV 1
  84. #define FPE_INTOVF 2
  85. #define FPE_FLTDIV 3
  86. #define FPE_FLTOVF 4
  87. #define FPE_FLTUNT 5
  88. #define FPE_FLTRES 6
  89. #define FPE_FLTINV 7
  90. #define FPE_FLTSUB 8
  91. #define ILL_ILLOPC 1
  92. #define ILL_ILLOPN 2
  93. #define ILL_ILLADR 3
  94. #define ILL_ILLTRP 4
  95. #define ILL_PRVOPC 5
  96. #define ILL_PRVREG 6
  97. #define ILL_COPROC 7
  98. #define ILL_BADSTK 8
  99. #define SEGV_MAPERR 1
  100. #define SEGV_ACCERR 2
  101. #define BUS_ADRALN 1
  102. #define BUS_ADRERR 2
  103. #define BUS_OBJERR 3
  104. #define CLD_EXITED 1
  105. #define CLD_KILLED 2
  106. #define CLD_DUMPED 3
  107. #define CLD_TRAPPED 4
  108. #define CLD_STOPPED 5
  109. #define CLD_CONTINUED 6
  110. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  111. #define TRAP_BRKPT 1
  112. #define TRAP_TRACE 2
  113. #define POLL_IN 1
  114. #define POLL_OUT 2
  115. #define POLL_MSG 3
  116. #define POLL_ERR 4
  117. #define POLL_PRI 5
  118. #define POLL_HUP 6
  119. #define SS_ONSTACK 1
  120. #define SS_DISABLE 2
  121. #define MINSIGSTKSZ 2048
  122. #define SIGSTKSZ 8192
  123. #endif
  124. #define SA_NOCLDSTOP 1
  125. #define SA_NOCLDWAIT 2
  126. #define SA_SIGINFO 4
  127. #define SA_ONSTACK 0x08000000
  128. #define SA_RESTART 0x10000000
  129. #define SA_NODEFER 0x40000000
  130. #define SA_RESETHAND 0x80000000
  131. #define SA_RESTORER 0x04000000
  132. #define SIG_BLOCK 0
  133. #define SIG_UNBLOCK 1
  134. #define SIG_SETMASK 2
  135. #endif
  136. #ifdef _GNU_SOURCE
  137. #define NSIG 64
  138. #endif
  139. #define SIG_ERR ((void (*)(int))-1)
  140. #define SIG_DFL ((void (*)(int)) 0)
  141. #define SIG_IGN ((void (*)(int)) 1)
  142. #define SIG_HOLD ((void (*)(int)) 2)
  143. #define SIGHUP 1
  144. #define SIGINT 2
  145. #define SIGQUIT 3
  146. #define SIGILL 4
  147. #define SIGTRAP 5
  148. #define SIGABRT 6
  149. #define SIGBUS 7
  150. #define SIGFPE 8
  151. #define SIGKILL 9
  152. #define SIGUSR1 10
  153. #define SIGSEGV 11
  154. #define SIGUSR2 12
  155. #define SIGPIPE 13
  156. #define SIGALRM 14
  157. #define SIGTERM 15
  158. #define SIGSTKFLT 16
  159. #define SIGCHLD 17
  160. #define SIGCONT 18
  161. #define SIGSTOP 19
  162. #define SIGTSTP 20
  163. #define SIGTTIN 21
  164. #define SIGTTOU 22
  165. #define SIGURG 23
  166. #define SIGXCPU 24
  167. #define SIGXFSZ 25
  168. #define SIGVTALRM 26
  169. #define SIGPROF 27
  170. #define SIGWINCH 28
  171. #define SIGIO 29
  172. #define SIGPOLL 29
  173. #define SIGPWR 30
  174. #define SIGSYS 31
  175. #define SIGUNUSED SIGSYS