summaryrefslogtreecommitdiff
path: root/libc/nptl/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/nptl/pthread_create.c')
-rw-r--r--libc/nptl/pthread_create.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/nptl/pthread_create.c b/libc/nptl/pthread_create.c
index 499e92e88..43d428239 100644
--- a/libc/nptl/pthread_create.c
+++ b/libc/nptl/pthread_create.c
@@ -462,8 +462,9 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
int err = ALLOCATE_STACK (iattr, &pd);
if (__builtin_expect (err != 0, 0))
/* Something went wrong. Maybe a parameter of the attributes is
- invalid or we could not allocate memory. */
- return err;
+ invalid or we could not allocate memory. Note we have to
+ translate error codes. */
+ return err == ENOMEM ? EAGAIN : err;
/* Initialize the TCB. All initializations with zero should be