mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-23 03:53:43 +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:
parent
bcca3ddcc0
commit
25739eec86
1 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue