8 // set this to REG_ECX on x86_32
13 void handle_segv(int segv, siginfo_t* siginfo, void* ucontext) {
14 ucontext_t* uc = (ucontext_t*) ucontext;
15 uc->uc_mcontext.gregs[myREG] = (greg_t) &k;
18 void cause_segv (void* ptr) {
21 asm ("movl (%%ecx), %%edx" : "=d"(d) : "c"(ptr));
28 q.sa_sigaction = handle_segv;
29 q.sa_flags = SA_SIGINFO;
30 sigaction(11, &q, NULL);