summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2004-02-16 22:51:12 +0000
committerBrad Smith <brad@cvs.openbsd.org>2004-02-16 22:51:12 +0000
commitca3a7bccf45390f8008dd4cf6f38c6771c2f2109 (patch)
treea172dcbac251c5f181a41700472eb0a2f1a36f0a /lib/libpthread/uthread
parent06f53a9a60706de8c848e3ce7d556f14e26a7d91 (diff)
fixes function parameters to match the man page as well
as adding a more aggressive arguement check. From: FreeBSD's libc_r. ok marc@
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r--lib/libpthread/uthread/uthread_create.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_create.c b/lib/libpthread/uthread/uthread_create.c
index 3cfbd3d6f32..8889b84ef95 100644
--- a/lib/libpthread/uthread/uthread_create.c
+++ b/lib/libpthread/uthread/uthread_create.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_create.c,v 1.19 2003/07/08 00:17:19 marc Exp $ */
+/* $OpenBSD: uthread_create.c,v 1.20 2004/02/16 22:51:11 brad Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -46,7 +46,7 @@
#include "pthread_private.h"
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();
@@ -58,6 +58,9 @@ pthread_create(pthread_t * thread, const pthread_attr_t * attr,
pthread_attr_t pattr;
struct stack *stack;
+ if (thread == NULL)
+ return(EINVAL);
+
/*
* Locking functions in libc are required when there are
* threads other than the initial thread.