From 85bea762ece17727518101d1a599068ee1341bb8 Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 14 Mar 1997 04:51:38 +0000 Subject: [PATCH] [project @ 1997-03-14 04:51:38 by sof] Nil_closure rename + Linux 2.x sigcontext include fix --- ghc/runtime/main/Signals.lc | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/ghc/runtime/main/Signals.lc b/ghc/runtime/main/Signals.lc index 6569d49..24220d4 100644 --- a/ghc/runtime/main/Signals.lc +++ b/ghc/runtime/main/Signals.lc @@ -19,7 +19,7 @@ Since they're pretty rudimentary, they shouldn't actually cause as much pain. \begin{code} -#include "platform.h" +#include "config.h" #if defined(sunos4_TARGET_OS) /* The sigaction in SunOS 4.1.X does not grok SA_SIGINFO */ @@ -52,8 +52,24 @@ much pain. #endif #if defined(linux_TARGET_OS) || defined(linuxaout_TARGET_OS) - /* to look *inside* sigcontext... */ -# include +/* to look *inside* sigcontext... + + sigcontext has moved and been protected from the General Public, + in later versions (>2), the sigcontext decl is protected by + a __KERNEL__ #ifdef. As ever, we workaround by trying to + be version savvy - the version numbers are currently just a guess! + (ToDo: determine at what version no. the sigcontext move + was made). +*/ +# ifndef LINUX_VERSION_CODE +# include +# endif +# if (LINUX_VERSION_CODE < 0x020000) +# include +# else +# include +# endif + #endif #if defined(HAVE_SIGINFO_H) @@ -62,7 +78,7 @@ much pain. #endif #if defined(cygwin32_TARGET_OS) -#include +# include #endif \end{code} @@ -155,7 +171,7 @@ segv_handler(sig) { /* From gdb/win32-nat.c */ DEBUG_EVENT event; - BOOL t = TRUE; /* WaitForDebugEvent (&event, INFINITE); */ + BOOL t = WaitForDebugEvent (&event, INFINITE); fflush(stdout); if (t == FALSE) { @@ -303,7 +319,7 @@ vtalrm_handler(int sig) if (delayTicks != 0) /* delayTicks>0 => don't handle timer expiry (in GC) */ delayTicks++; - else if (WaitingThreadsHd != Prelude_Z91Z93_closure) + else if (WaitingThreadsHd != PrelBase_Z91Z93_closure) AwaitEvent(RTSflags.ConcFlags.ctxtSwitchTime); # ifdef PAR @@ -322,7 +338,7 @@ vtalrm_handler(int sig) if (CurrentTSO != NULL || # else - if (RunnableThreadsHd != Prelude_Z91Z93_closure || + if (RunnableThreadsHd != PrelBase_Z91Z93_closure || # endif PendingSparksHd[REQUIRED_POOL] < PendingSparksTl[REQUIRED_POOL] || PendingSparksHd[ADVISORY_POOL] < PendingSparksTl[ADVISORY_POOL]) { -- 1.7.10.4