make pthread_create return EAGAIN on resource failure, as required by POSIX
authorRich Felker <dalias@aerifal.cx>
Tue, 15 Feb 2011 07:20:21 +0000 (02:20 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 15 Feb 2011 07:20:21 +0000 (02:20 -0500)
src/thread/pthread_create.c

index 72d7acbcf80310d09abc8d38984bdb78f432e789..d01be551c1b54f21935b5970d6215cddb830465d 100644 (file)
@@ -212,7 +212,7 @@ int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(vo
        if (ret < 0) {
                a_dec(&libc.threads_minus_1);
                munmap(map, size);
-               return -ret;
+               return EAGAIN;
        }
        *res = new;
        return 0;