signal.h 3.8 KB

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