functional: add mntent test
[libc-test.git] / src / regression / pthread_create-oom.c
blobc52a914efd72e2fa4c04c0b820ebf4065d034cca
1 // commit: 59666802fba592a59f2f4ea4dcb053287fd55826 2011-02-15
2 // pthread_create should return EAGAIN on failure
3 #include <pthread.h>
4 #include <errno.h>
5 #include <string.h>
6 #include "test.h"
8 static void *start(void *arg)
10 return 0;
13 int main(void)
15 pthread_t td;
16 int r, arg;
18 if (t_memfill() < 0)
19 t_error("memfill failed\n");
20 r = pthread_create(&td, 0, start, &arg);
21 if (r == 0)
22 t_error("pthread_create succeeded\n");
23 else if (r != EAGAIN)
24 t_error("pthread_create should fail with EAGAIN but failed with %d (%s)\n", r, strerror(r));
26 return t_status;