signal.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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[34];
  9. typedef struct sigcontext {
  10. struct {
  11. unsigned long gpr[32];
  12. unsigned long pc;
  13. unsigned long sr;
  14. } regs;
  15. unsigned long oldmask;
  16. } mcontext_t;
  17. #else
  18. typedef struct {
  19. unsigned long __regs[35];
  20. } mcontext_t;
  21. #endif
  22. struct sigaltstack {
  23. void *ss_sp;
  24. int ss_flags;
  25. size_t ss_size;
  26. };
  27. typedef struct __ucontext {
  28. unsigned long uc_flags;
  29. struct __ucontext *uc_link;
  30. stack_t uc_stack;
  31. mcontext_t uc_mcontext;
  32. sigset_t uc_sigmask;
  33. } ucontext_t;
  34. #define SA_NOCLDSTOP 1
  35. #define SA_NOCLDWAIT 2
  36. #define SA_SIGINFO 4
  37. #define SA_ONSTACK 0x08000000
  38. #define SA_RESTART 0x10000000
  39. #define SA_NODEFER 0x40000000
  40. #define SA_RESETHAND 0x80000000
  41. #endif
  42. #define SIGHUP 1
  43. #define SIGINT 2
  44. #define SIGQUIT 3
  45. #define SIGILL 4
  46. #define SIGTRAP 5
  47. #define SIGABRT 6
  48. #define SIGIOT SIGABRT
  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
  76. #define _NSIG 65