signal.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  2. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3. typedef struct {
  4. unsigned __mc1[2];
  5. unsigned long long __mc2[65];
  6. unsigned __mc3[5];
  7. unsigned long long __mc4[2];
  8. unsigned __mc5[6];
  9. } mcontext_t;
  10. typedef struct __ucontext {
  11. unsigned long uc_flags;
  12. struct __ucontext *uc_link;
  13. stack_t uc_stack;
  14. mcontext_t uc_mcontext;
  15. sigset_t uc_sigmask;
  16. unsigned long uc_regspace[128];
  17. } ucontext_t;
  18. #define SA_NOCLDSTOP 1
  19. #define SA_NOCLDWAIT 0x10000
  20. #define SA_SIGINFO 8
  21. #define SA_ONSTACK 0x08000000
  22. #define SA_RESTART 0x10000000
  23. #define SA_NODEFER 0x40000000
  24. #define SA_RESETHAND 0x80000000
  25. #define SA_RESTORER 0x04000000
  26. #define SIG_BLOCK 1
  27. #define SIG_UNBLOCK 2
  28. #define SIG_SETMASK 3
  29. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  30. struct sigcontext
  31. {
  32. unsigned sc_regmask, sc_status;
  33. unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
  34. unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
  35. unsigned long long sc_mdhi, sc_mdlo;
  36. unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
  37. };
  38. #define NSIG 64
  39. #endif
  40. #endif
  41. #define SIGHUP 1
  42. #define SIGINT 2
  43. #define SIGQUIT 3
  44. #define SIGILL 4
  45. #define SIGTRAP 5
  46. #define SIGABRT 6
  47. #define SIGIOT SIGABRT
  48. #define SIGSTKFLT 7
  49. #define SIGFPE 8
  50. #define SIGKILL 9
  51. #define SIGBUS 10
  52. #define SIGSEGV 11
  53. #define SIGSYS 12
  54. #define SIGPIPE 13
  55. #define SIGALRM 14
  56. #define SIGTERM 15
  57. #define SIGUSR1 16
  58. #define SIGUSR2 17
  59. #define SIGCHLD 18
  60. #define SIGPWR 19
  61. #define SIGWINCH 20
  62. #define SIGURG 21
  63. #define SIGIO 22
  64. #define SIGPOLL SIGIO
  65. #define SIGSTOP 23
  66. #define SIGTSTP 24
  67. #define SIGCONT 25
  68. #define SIGTTIN 26
  69. #define SIGTTOU 27
  70. #define SIGVTALRM 28
  71. #define SIGPROF 29
  72. #define SIGXCPU 30
  73. #define SIGXFSZ 31
  74. #define SIGUNUSED SIGSYS