diff options
Diffstat (limited to 'src/threads/thrd_create.c')
| -rw-r--r-- | src/threads/thrd_create.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/threads/thrd_create.c b/src/threads/thrd_create.c index 516c0c66..100d16cc 100644 --- a/src/threads/thrd_create.c +++ b/src/threads/thrd_create.c @@ -1,8 +1,20 @@ #include <threads.h> #include <pthread.h> +#include <errno.h> int thrd_create(thrd_t *thr, thrd_start_t func, void *arg) { typedef void *(*pthread_start_fn)(void*); - return pthread_create(thr, 0, (pthread_start_fn)func, arg); + switch (pthread_create(thr, 0, (pthread_start_fn)func, arg)) { + case 0: + return thrd_success; + + case ENOMEM: + return thrd_nomem; + + default: + break; + } + + return thrd_error; } |
