1 #include <stdio.h>
2 #include <stddef.h>
3 #include <ucontext.h>
4
5 #define UC(N,X) \
6 printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X))
7
8 #define SC(N,X) \
9 printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X))
10
11 int
main(void)12 main (void)
13 {
14 printf (
15 "/* Linux-specific definitions: */\n\n"
16
17 "/* Define various structure offsets to simplify cross-compilation. */\n\n"
18
19 "/* Offsets for MIPS Linux \"ucontext_t\": */\n\n");
20
21 UC ("FLAGS", uc_flags);
22 UC ("LINK", uc_link);
23 UC ("STACK", uc_stack);
24 UC ("MCONTEXT", uc_mcontext);
25 UC ("SIGMASK", uc_sigmask);
26
27 UC ("MCONTEXT_GREGS", uc_mcontext.gregs);
28
29 return 0;
30 }
31