Build fixes for Red Hat 6.2.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@248 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h
index 5dca560..f280ef8 100644
--- a/coregrind/vg_include.h
+++ b/coregrind/vg_include.h
@@ -672,7 +672,9 @@
    ------------------------------------------------------------------ */
 
 
-#define NULL ((void*)0)
+#if !defined(NULL)
+#  define NULL ((void*)0)
+#endif
 
 extern void VG_(exit)( Int status )
             __attribute__ ((__noreturn__));
diff --git a/coregrind/vg_unsafe.h b/coregrind/vg_unsafe.h
index bbc417d..260def9 100644
--- a/coregrind/vg_unsafe.h
+++ b/coregrind/vg_unsafe.h
@@ -62,7 +62,10 @@
 
 #include <asm/ioctls.h>   /* for stuff for dealing with ioctl :( */
 #include <sys/soundcard.h> /* for various soundcard ioctl constants :( */
-#include <linux/rtc.h>     /* for RTC_* ioctls */
+
+#ifndef GLIBC_2_1
+#  include <linux/rtc.h>   /* for RTC_* ioctls */
+#endif
 
 #include <termios.h>
 #include <pty.h>
diff --git a/vg_include.h b/vg_include.h
index 5dca560..f280ef8 100644
--- a/vg_include.h
+++ b/vg_include.h
@@ -672,7 +672,9 @@
    ------------------------------------------------------------------ */
 
 
-#define NULL ((void*)0)
+#if !defined(NULL)
+#  define NULL ((void*)0)
+#endif
 
 extern void VG_(exit)( Int status )
             __attribute__ ((__noreturn__));
diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c
index cee1ac5..472f8f3 100644
--- a/vg_syscall_mem.c
+++ b/vg_syscall_mem.c
@@ -1779,6 +1779,7 @@
                break;
 
             /* Real Time Clock (/dev/rtc) ioctls */
+#           ifndef GLIBC_2_1
             case RTC_UIE_ON:
             case RTC_UIE_OFF:
             case RTC_AIE_ON:
@@ -1808,6 +1809,7 @@
                if(!VG_(is_kerror) && res == 0)
                    make_readable(arg3, sizeof(unsigned long));
                break;
+#           endif /* GLIBC_2_1 */
 
             /* CD ROM stuff (??)  */
             case CDROMSUBCHNL:
diff --git a/vg_unsafe.h b/vg_unsafe.h
index bbc417d..260def9 100644
--- a/vg_unsafe.h
+++ b/vg_unsafe.h
@@ -62,7 +62,10 @@
 
 #include <asm/ioctls.h>   /* for stuff for dealing with ioctl :( */
 #include <sys/soundcard.h> /* for various soundcard ioctl constants :( */
-#include <linux/rtc.h>     /* for RTC_* ioctls */
+
+#ifndef GLIBC_2_1
+#  include <linux/rtc.h>   /* for RTC_* ioctls */
+#endif
 
 #include <termios.h>
 #include <pty.h>