diff options
Diffstat (limited to 'lib/libc_r')
-rw-r--r-- | lib/libc_r/uthread/uthread_create.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_create.c b/lib/libc_r/uthread/uthread_create.c index 0f006a9..6769428 100644 --- a/lib/libc_r/uthread/uthread_create.c +++ b/lib/libc_r/uthread/uthread_create.c @@ -59,7 +59,7 @@ int _thread_PS_DEAD_value = PS_DEAD; __weak_reference(_pthread_create, pthread_create); int -_pthread_create(pthread_t * thread, const pthread_attr_t * attr, +_pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg) { struct pthread *curthread = _get_curthread(); @@ -71,6 +71,9 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, pthread_attr_t pattr; void *stack; + if (thread == NULL) + return(EINVAL); + /* * Locking functions in libc are required when there are * threads other than the initial thread. |