From: Florian Krohm Date: Fri, 21 Oct 2011 02:32:49 +0000 (+0000) Subject: Adapt the faultstatus.c testcase to work properly on systems with larger X-Git-Tag: svn/VALGRIND_3_7_0~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f16332169240f52b53d03f90438c7f90d48a488c;p=thirdparty%2Fvalgrind.git Adapt the faultstatus.c testcase to work properly on systems with larger 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 --- diff --git a/none/tests/faultstatus.c b/none/tests/faultstatus.c index 4f2de03dd8..230865cc26 100644 --- a/none/tests/faultstatus.c +++ b/none/tests/faultstatus.c @@ -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);