From 32e6eba7b70bc97dd76d8134160ccb4d2670951a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 4 Aug 2006 15:22:16 +0000 Subject: [PATCH] restore Linux case, try a different types for a generic case svn: r3957 --- src/mzscheme/gc2/sighand.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/mzscheme/gc2/sighand.c b/src/mzscheme/gc2/sighand.c index ef222d7352..7a05453f6b 100644 --- a/src/mzscheme/gc2/sighand.c +++ b/src/mzscheme/gc2/sighand.c @@ -11,6 +11,17 @@ /* platform-specific handlers */ /******************************************************************************/ +/* ========== Linux signal handler ========== */ +#if defined(linux) +# include +void fault_handler(int sn, struct siginfo *si, void *ctx) +{ + designate_modified(si->si_addr); +# define NEED_SIGACTION +# define USE_SIGACTON_SIGNAL_KIND SIGSEGV +} +#endif + /* ========== FreeBSD signal handler ========== */ #if defined(__FreeBSD__) # include @@ -55,10 +66,14 @@ typedef LONG (WINAPI*gcPVECTORED_EXCEPTION_HANDLER)(LPEXCEPTION_POINTERS e); # define NEED_OSX_MACH_HANDLER #endif -/* ========== Generic Unix handler ========== */ +/* ========== Generic Unix signal handler ========== */ +/* There's little guarantee that this will work, since + Unix variants differ in the types of the arguments. + When a platform doesn't match, make a special case + for it, like all the others above. */ #if !defined(NEED_SIGACTION) && !defined(NEED_SIGWIN) && !defined(NEED_OSX_MACH_HANDLER) # include -void fault_handler(int sn, struct siginfo *si, void *ctx) +void fault_handler(int sn, siginfo_t *si, void *ctx) { designate_modified(si->si_addr); # define NEED_SIGACTION