Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

sighandler_platform.c

Go to the documentation of this file.
00001 
00010 #define _GNU_SOURCE /* for REG_RIP */
00011 #include "sigsafe_internal.h"
00012 #include <ucontext.h>
00013 #include <unistd.h>
00014 
00015 void sigsafe_handler_for_platform_(ucontext_t *ctx) {
00016     struct sigsafe_syscall_ *s;
00017     void *rip;
00018     rip = (void*) ctx->uc_mcontext.gregs[REG_RIP];
00019     for (s = sigsafe_syscalls_; s->minjmp != NULL; s++) {
00020         if (s->minjmp <= rip && rip <= s->maxjmp) {
00021 #ifdef SIGSAFE_DEBUG_JUMP
00022             write(2, "[J]", 3);
00023 #endif
00024             ctx->uc_mcontext.gregs[REG_RIP] = (long) s->jmpto;
00025             return;
00026         }
00027     }
00028 }

Generated on Fri Feb 4 11:13:32 2005 for sigsafe by doxygen 1.3.5