|
From: <sv...@va...> - 2011-03-15 08:13:17
|
Author: sewardj
Date: 2011-03-15 08:13:08 +0000 (Tue, 15 Mar 2011)
New Revision: 11644
Log:
Some fixes for the faultstatus testcase. Fixes #253206.
(Christian Borntraeger, bor...@de...)
Modified:
trunk/none/tests/faultstatus.c
Modified: trunk/none/tests/faultstatus.c
===================================================================
--- trunk/none/tests/faultstatus.c 2011-03-14 09:53:44 UTC (rev 11643)
+++ trunk/none/tests/faultstatus.c 2011-03-15 08:13:08 UTC (rev 11644)
@@ -70,7 +70,13 @@
static int testaddr(void *addr, volatile void *want)
{
+ /* Some architectures (e.g. s390) just provide enough information to
+ resolve the page fault, but do not provide the offset within a page */
+#if defined(__s390__)
+ if (addr != (void *) ((unsigned long) want & ~0xffful)) {
+#else
if (addr != want) {
+#endif
fprintf(stderr, " FAIL: expected si_addr==%p, not %p\n", want, addr);
return 0;
}
@@ -132,7 +138,8 @@
for(i = 0; i < sizeof(sigs)/sizeof(*sigs); i++)
sigaction(sigs[i], &sa, NULL);
- fd = open("faultstatus.tmp", O_CREAT|O_TRUNC|O_EXCL, 0600);
+ /* we need O_RDWR for the truncate below */
+ fd = open("faultstatus.tmp", O_CREAT|O_TRUNC|O_EXCL|O_RDWR, 0600);
if (fd == -1) {
perror("tmpfile");
exit(1);
|