ucontext.h 710 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _UCONTEXT_H
  2. #define _UCONTEXT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <signal.h>
  7. struct __fpstate {
  8. unsigned long __x[7];
  9. unsigned char __y[80];
  10. unsigned long __z;
  11. };
  12. typedef struct {
  13. unsigned long __gregs[19];
  14. void *__fpregs;
  15. unsigned long __oldmask, __cr2;
  16. } mcontext_t;
  17. typedef struct __ucontext {
  18. unsigned long uc_flags;
  19. struct __ucontext *uc_link;
  20. stack_t uc_stack;
  21. mcontext_t uc_mcontext;
  22. sigset_t uc_sigmask;
  23. struct __fpstate __fpregs_mem;
  24. } ucontext_t;
  25. int getcontext(ucontext_t *);
  26. void makecontext(ucontext_t *, void (*)(void), int, ...);
  27. int setcontext(const ucontext_t *);
  28. int swapcontext(ucontext_t *, const ucontext_t *);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif