1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-22 19:43:42 +01:00

[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.
This commit is contained in:
David Mosberger-Tang 2007-08-09 16:26:58 -06:00
parent bcca3ddcc0
commit 25739eec86

View file

@ -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);
}
}