signal.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #define SA_NOCLDSTOP 1
  22. #define SA_NOCLDWAIT 2
  23. #define SA_SIGINFO 4
  24. #define SA_ONSTACK 0x08000000
  25. #define SA_RESTART 0x10000000
  26. #define SA_NODEFER 0x40000000
  27. #define SA_RESETHAND 0x80000000
  28. #define SA_RESTORER 0x04000000
  29. #ifdef _GNU_SOURCE
  30. struct sigcontext {
  31. unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
  32. unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
  33. unsigned long trapno, err, eip;
  34. unsigned short cs, __csh;
  35. unsigned long eflags, esp_at_signal;
  36. unsigned short ss, __ssh;
  37. struct __fpstate *fpstate;
  38. unsigned long oldmask, cr2;
  39. };
  40. #define NSIG 64
  41. #endif
  42. #endif
  43. #define SIGHUP 1
  44. #define SIGINT 2
  45. #define SIGQUIT 3
  46. #define SIGILL 4
  47. #define SIGTRAP 5
  48. #define SIGABRT 6
  49. #define SIGBUS 7
  50. #define SIGFPE 8
  51. #define SIGKILL 9
  52. #define SIGUSR1 10
  53. #define SIGSEGV 11
  54. #define SIGUSR2 12
  55. #define SIGPIPE 13
  56. #define SIGALRM 14
  57. #define SIGTERM 15
  58. #define SIGSTKFLT 16
  59. #define SIGCHLD 17
  60. #define SIGCONT 18
  61. #define SIGSTOP 19
  62. #define SIGTSTP 20
  63. #define SIGTTIN 21
  64. #define SIGTTOU 22
  65. #define SIGURG 23
  66. #define SIGXCPU 24
  67. #define SIGXFSZ 25
  68. #define SIGVTALRM 26
  69. #define SIGPROF 27
  70. #define SIGWINCH 28
  71. #define SIGIO 29
  72. #define SIGPOLL 29
  73. #define SIGPWR 30
  74. #define SIGSYS 31
  75. #define SIGUNUSED SIGSYS