+2011-12-14 Carlos O'Donell <carlos@systemhalted.org>
+
+ * allocatestack.c (allocate_stack): Return errno on failure.
+
2011-12-14 Jeff Law <law@redhat.com>
[BZ #5245]
{
/* Something went wrong. */
assert (errno == ENOMEM);
- return EAGAIN;
+ return errno;
}
MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
if (__builtin_expect (mem == MAP_FAILED, 0))
- {
- if (errno == ENOMEM)
- __set_errno (EAGAIN);
-
- return errno;
- }
+ return errno;
/* SIZE is guaranteed to be greater than zero.
So we can never get a null pointer back from mmap. */
/* Free the stack memory we just allocated. */
(void) munmap (mem, size);
- return EAGAIN;
+ return errno;
}
#endif
if (mprotect (guard, guardsize, PROT_NONE) != 0)
{
- int err;
mprot_error:
- err = errno == ENOMEM ? EAGAIN : errno;
-
lll_lock (stack_cache_lock, LLL_PRIVATE);
/* Remove the thread from the list. */
is nothing we could do. */
(void) munmap (mem, size);
- return err;
+ return errno;
}
pd->guardsize = guardsize;