Viet-Trung Luu | 96b05c1 | 2016-01-11 11:26:36 -0800 | [diff] [blame] | 1 | #ifndef _UCONTEXT_H |
| 2 | #define _UCONTEXT_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
| 7 | #include <features.h> |
| 8 | |
| 9 | #include <signal.h> |
| 10 | |
| 11 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
George Kulakowski | 17e3b04 | 2016-02-18 15:59:50 -0800 | [diff] [blame] | 12 | #define NGREG (sizeof(gregset_t) / sizeof(greg_t)) |
Viet-Trung Luu | 96b05c1 | 2016-01-11 11:26:36 -0800 | [diff] [blame] | 13 | #endif |
| 14 | |
| 15 | struct __ucontext; |
| 16 | |
George Kulakowski | 17e3b04 | 2016-02-18 15:59:50 -0800 | [diff] [blame] | 17 | int getcontext(struct __ucontext*); |
| 18 | void makecontext(struct __ucontext*, void (*)(void), int, ...); |
| 19 | int setcontext(const struct __ucontext*); |
| 20 | int swapcontext(struct __ucontext*, const struct __ucontext*); |
Viet-Trung Luu | 96b05c1 | 2016-01-11 11:26:36 -0800 | [diff] [blame] | 21 | |
| 22 | #ifdef __cplusplus |
| 23 | } |
| 24 | #endif |
| 25 | #endif |