|
From: Bart V. A. <bva...@ac...> - 2011-11-17 19:48:35
|
On Thu, Nov 17, 2011 at 2:44 AM, Rich Coe <rc...@wi...> wrote:
> How about ...
>
> #include <sys/mman.h>
> #ifndef MREMAP_FIXED /* not defined by RHEL 4 */
> #include <linux/mman.h>
> #endif
I'd rather prefer something like this:
Index: memcheck/tests/x86-linux/scalar.c
===================================================================
--- memcheck/tests/x86-linux/scalar.c (revision 12271)
+++ memcheck/tests/x86-linux/scalar.c (working copy)
@@ -5,8 +5,9 @@
#include <unistd.h>
#include <sched.h>
#include <signal.h>
-#include <linux/mman.h> // MREMAP_FIXED
-
+#ifndef MREMAP_FIXED
+#define MREMAP_FIXED 2 // For RHEL 4
+#endif
// Here we are trying to trigger every syscall error (scalar errors and
// memory errors) for every syscall. We do this by passing a lot of bogus
// arguments, mostly 0 and 1 (often it's 1 because NULL ptr args often aren't
@@ -23,7 +24,6 @@
// The output has numbers like "3s 2m" for each syscall. "s" is short for
// "scalar", ie. the argument itself is undefined. "m" is short for "memory",
// ie. the argument points to memory which is unaddressable.
-
int main(void)
{
// uninitialised, but we know px[0] is 0x0
Bart.
|