1
0

signal.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 unsigned long greg_t, gregset_t[38];
  9. typedef struct sigcontext {
  10. struct {
  11. unsigned long r0, r1, r2, r3, r4, r5, r6, r7;
  12. unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
  13. unsigned long r16, r17, r18, r19, r20, r21, r22, r23;
  14. unsigned long r24, r25, r26, r27, r28, r29, r30, r31;
  15. unsigned long pc, msr, ear, esr, fsr;
  16. int pt_mode;
  17. } regs;
  18. unsigned long oldmask;
  19. } mcontext_t;
  20. #else
  21. typedef struct {
  22. unsigned long __regs[39];
  23. } mcontext_t;
  24. #endif
  25. struct sigaltstack {
  26. void *ss_sp;
  27. int ss_flags;
  28. size_t ss_size;
  29. };
  30. typedef struct __ucontext {
  31. unsigned long uc_flags;
  32. struct __ucontext *uc_link;
  33. stack_t uc_stack;
  34. mcontext_t uc_mcontext;
  35. sigset_t uc_sigmask;
  36. } ucontext_t;
  37. #define SA_NOCLDSTOP 1
  38. #define SA_NOCLDWAIT 2
  39. #define SA_SIGINFO 4
  40. #define SA_ONSTACK 0x08000000
  41. #define SA_RESTART 0x10000000
  42. #define SA_NODEFER 0x40000000
  43. #define SA_RESETHAND 0x80000000
  44. #endif
  45. #define SIGHUP 1
  46. #define SIGINT 2
  47. #define SIGQUIT 3
  48. #define SIGILL 4
  49. #define SIGTRAP 5
  50. #define SIGABRT 6
  51. #define SIGIOT SIGABRT
  52. #define SIGBUS 7
  53. #define SIGFPE 8
  54. #define SIGKILL 9
  55. #define SIGUSR1 10
  56. #define SIGSEGV 11
  57. #define SIGUSR2 12
  58. #define SIGPIPE 13
  59. #define SIGALRM 14
  60. #define SIGTERM 15
  61. #define SIGSTKFLT 16
  62. #define SIGCHLD 17
  63. #define SIGCONT 18
  64. #define SIGSTOP 19
  65. #define SIGTSTP 20
  66. #define SIGTTIN 21
  67. #define SIGTTOU 22
  68. #define SIGURG 23
  69. #define SIGXCPU 24
  70. #define SIGXFSZ 25
  71. #define SIGVTALRM 26
  72. #define SIGPROF 27
  73. #define SIGWINCH 28
  74. #define SIGIO 29
  75. #define SIGPOLL 29
  76. #define SIGPWR 30
  77. #define SIGSYS 31
  78. #define SIGUNUSED SIGSYS
  79. #define _NSIG 65