1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

BZ #5245: pthread_create returns EAGAIN for stack allocation failure, not ENOMEM.

This commit is contained in:
Jeff Law
2011-12-14 13:14:56 -08:00
committed by Roland McGrath
parent 26428b7c69
commit e988dba98d
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-12-14 Jeff Law <law@redhat.com>
[BZ #5245]
* pthread_create.c (__pthread_create_2_1): Translate ENOMEM to EAGAIN.
2011-11-28 Andreas Schwab <schwab@redhat.com> 2011-11-28 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle

View File

@ -457,8 +457,9 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
int err = ALLOCATE_STACK (iattr, &pd); int err = ALLOCATE_STACK (iattr, &pd);
if (__builtin_expect (err != 0, 0)) if (__builtin_expect (err != 0, 0))
/* Something went wrong. Maybe a parameter of the attributes is /* Something went wrong. Maybe a parameter of the attributes is
invalid or we could not allocate memory. */ invalid or we could not allocate memory. Note we have to
return err; translate error codes. */
return err == ENOMEM ? EAGAIN : err;
/* Initialize the TCB. All initializations with zero should be /* Initialize the TCB. All initializations with zero should be