]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Adapt the faultstatus.c testcase to work properly on systems with larger
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 21 Oct 2011 02:32:49 +0000 (02:32 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 21 Oct 2011 02:32:49 +0000 (02:32 +0000)
page size. E.g. ppc64 running SLES 11 has 64k pages.
Patch by Maynard Johnson (maynardj@us.ibm.com) with small modification
to minimize source code changes. Fixes bugzilla #283709.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12183

none/tests/faultstatus.c

index 4f2de03dd8b1e2f0aec64878c07801803ae39fd9..230865cc26a9dc1954f03bb38430566b236772ea 100644 (file)
@@ -45,9 +45,9 @@ static jmp_buf escape;
 
 #define BADADDR        ((int *)0x1234)
 
-#define FILESIZE       (16*1024)
+#define FILESIZE       (4*__pagesize)
 #define MAPSIZE                (2*FILESIZE)
-
+static unsigned int __pagesize;
 static char volatile *volatile mapping;
 
 static int testsig(int sig, int want)
@@ -130,7 +130,7 @@ int main()
        int fd, i;
        static const int sigs[] = { SIGSEGV, SIGILL, SIGBUS, SIGFPE, SIGTRAP };
        struct sigaction sa;
-
+       __pagesize = (unsigned int)sysconf(_SC_PAGE_SIZE);
        sa.sa_sigaction = handler;
        sa.sa_flags = SA_SIGINFO;
        sigfillset(&sa.sa_mask);