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 72d7acb..d01be55 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;