signal.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 int greg_t, gregset_t[18];
  9. typedef struct sigcontext {
  10. unsigned long trap_no, error_code, oldmask;
  11. unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
  12. unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
  13. unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
  14. unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
  15. unsigned long arm_cpsr, fault_address;
  16. } mcontext_t;
  17. #else
  18. typedef struct {
  19. unsigned long __regs[21];
  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. unsigned long long uc_regspace[64];
  34. } ucontext_t;
  35. #define SA_NOCLDSTOP 1
  36. #define SA_NOCLDWAIT 2
  37. #define SA_SIGINFO 4
  38. #define SA_ONSTACK 0x08000000
  39. #define SA_RESTART 0x10000000
  40. #define SA_NODEFER 0x40000000
  41. #define SA_RESETHAND 0x80000000
  42. #define SA_RESTORER 0x04000000
  43. #endif
  44. #define SIGHUP 1
  45. #define SIGINT 2
  46. #define SIGQUIT 3
  47. #define SIGILL 4
  48. #define SIGTRAP 5
  49. #define SIGABRT 6
  50. #define SIGIOT SIGABRT
  51. #define SIGBUS 7
  52. #define SIGFPE 8
  53. #define SIGKILL 9
  54. #define SIGUSR1 10
  55. #define SIGSEGV 11
  56. #define SIGUSR2 12
  57. #define SIGPIPE 13
  58. #define SIGALRM 14
  59. #define SIGTERM 15
  60. #define SIGSTKFLT 16
  61. #define SIGCHLD 17
  62. #define SIGCONT 18
  63. #define SIGSTOP 19
  64. #define SIGTSTP 20
  65. #define SIGTTIN 21
  66. #define SIGTTOU 22
  67. #define SIGURG 23
  68. #define SIGXCPU 24
  69. #define SIGXFSZ 25
  70. #define SIGVTALRM 26
  71. #define SIGPROF 27
  72. #define SIGWINCH 28
  73. #define SIGIO 29
  74. #define SIGPOLL 29
  75. #define SIGPWR 30
  76. #define SIGSYS 31
  77. #define SIGUNUSED SIGSYS
  78. #define _NSIG 65