From 25739eec8667ae3a78a62b44a912a7fbcda3d43d Mon Sep 17 00:00:00 2001 From: David Mosberger-Tang Date: Thu, 9 Aug 2007 16:26:58 -0600 Subject: [PATCH] [IA64] Fix ia64-test-setjmp.c. With MAP_SHARED the kernel will try to find a 1MiB-aligned region, which isn't what we want here. --- tests/ia64-test-setjmp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ia64-test-setjmp.c b/tests/ia64-test-setjmp.c index 9bcc50c2..be487b66 100644 --- a/tests/ia64-test-setjmp.c +++ b/tests/ia64-test-setjmp.c @@ -79,6 +79,7 @@ static void doit (int n) { uintptr_t guard_page_addr, bsp = get_bsp (); + void *ret; if (n == 0) { @@ -87,10 +88,15 @@ doit (int n) guard_page_addr = (bsp + page_size - 1) & -page_size; if (verbose) printf ("guard_page_addr = 0x%lx\n", (unsigned long) guard_page_addr); - if (mmap ((void *) guard_page_addr, page_size, PROT_NONE, - MAP_SHARED | MAP_ANONYMOUS, -1, 0) != (void *) guard_page_addr) + ret = mmap ((void *) guard_page_addr, page_size, PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (ret != (void *) guard_page_addr) { - perror ("mmap"); + if (ret == MAP_FAILED) + perror ("mmap"); + else + fprintf (stderr, "mmap() returned %p, expected 0x%lx\n", + ret, guard_page_addr); exit (EXIT_FAILURE); } }