00001
00010 #include "sigsafe.h"
00011
00012 #ifndef SIGSAFE_INTERNAL_H
00013 #define SIGSAFE_INTERNAL_H
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if defined(__APPLE_CC__)
00023 #define PRIVATE_DEF(sym) __private_extern__ sym
00024 #define PRIVATE_DEC(sym) __private_extern__ sym
00025 #elif defined(__GNUC__)
00026 #define PRIVATE_DEF(sym) extern __attribute__ ((visibility ("internal"))) sym
00027 #define PRIVATE_DEC(sym) __attribute__ ((visibility ("internal"))) sym
00028 #else
00029 #error "Don't know how to make symbols private on your platform."
00030 #endif
00031
00038 #if defined(SIGMAX)
00039 #define SIGSAFE_SIGMAX SIGMAX
00040 #elif defined(NSIG)
00041 #define SIGSAFE_SIGMAX (NSIG-1)
00042 #elif defined(_NSIG)
00043 #define SIGSAFE_SIGMAX (_NSIG-1)
00044 #else
00045 #error Not sure how many signals you have
00046 #endif
00047
00049 struct sigsafe_tsd_ {
00051 volatile sig_atomic_t signal_received;
00052 intptr_t user_data;
00053 void (*destructor)(intptr_t);
00054 };
00055
00056 struct sigsafe_syscall_ {
00057 const void *minjmp;
00058 const void *maxjmp;
00059 const void *jmpto;
00060 };
00061
00062 PRIVATE_DEF(struct sigsafe_syscall_ sigsafe_syscalls_[]);
00063
00064 #ifdef SIGSAFE_NO_SIGINFO
00065 PRIVATE_DEF(void sigsafe_handler_for_platform_(struct sigcontext *ctx));
00066 #else
00067 PRIVATE_DEF(void sigsafe_handler_for_platform_(ucontext_t *ctx));
00068 #endif
00069
00070 #endif