2
0

signal.h 2.2 KB

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