regex memory corruption regression test
[libc-test] / src / regression / pthread_create-oom.c
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"
7
8 static void *start(void *arg)
9 {
10         return 0;
11 }
12
13 int main(void)
14 {
15         pthread_t td;
16         int r, arg;
17
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));
25
26         return t_status;
27 }