|
From: <sv...@va...> - 2011-10-21 02:37:48
|
Author: florian
Date: 2011-10-21 03:32:49 +0100 (Fri, 21 Oct 2011)
New Revision: 12183
Log:
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 (may...@us...) with small modification
to minimize source code changes. Fixes bugzilla #283709.
Modified:
trunk/none/tests/faultstatus.c
Modified: trunk/none/tests/faultstatus.c
===================================================================
--- trunk/none/tests/faultstatus.c 2011-10-20 23:00:37 UTC (rev 12182)
+++ trunk/none/tests/faultstatus.c 2011-10-21 02:32:49 UTC (rev 12183)
@@ -45,9 +45,9 @@
#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 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);
|