/* Allocate the DTV for this thread. */
if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
- /* Something went wrong. */
- return errno;
+ {
+ /* Something went wrong. */
+ assert (errno == ENOMEM);
+ return EAGAIN;
+ }
/* Prepare to modify global data. */
if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
{
/* Something went wrong. */
- int err = errno;
+ assert (errno == ENOMEM);
/* Free the stack memory we just allocated. */
(void) munmap (mem, size);
- return err;
+ return EAGAIN;
}