From e988dba98d852d08707d00eec0072548fdf2eb24 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 14 Dec 2011 13:14:56 -0800 Subject: BZ #5245: pthread_create returns EAGAIN for stack allocation failure, not ENOMEM. --- nptl/pthread_create.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nptl/pthread_create.c') diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index f1113fb..6250d03 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -457,8 +457,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 -- cgit v1.1