A minimal set of changes to make it work on Red Hat 9, at least in the
interim.  All hats off to Graydon Hoare for this, plus to whoever
devised the LD_ASSUME_KERNEL trapdoor.

This does not provide NPTL support.  Instead it turns out we can ask
for the old LinuxThreads interface to be used (wonderful!)

Other than that we have to deal with kernels with SYSINFO pages at the
top of memory.  No big deal, apparently.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1508 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index 78779bb..2a4daaa 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -1349,8 +1349,12 @@
 
 Bool SK_(cheap_sanity_check) ( void )
 {
-   if (IS_DISTINGUISHED_SM(primary_map[0]) && 
-       IS_DISTINGUISHED_SM(primary_map[65535]))
+   if (IS_DISTINGUISHED_SM(primary_map[0])
+       /* kludge: kernel drops a page up at top of address range for
+          magic "optimized syscalls", so we can no longer check the
+          highest page */
+       /* && IS_DISTINGUISHED_SM(primary_map[65535]) */
+      )
       return True;
    else
       return False;