summaryrefslogtreecommitdiff
path: root/nptl/pthread_setconcurrency.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-15 08:21:36 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-15 08:21:36 +0000
commitb270b5484067210c84822a28e63be9099e0d112b (patch)
tree43905aba4166a3b238e72588bcf14c9e8d6d6550 /nptl/pthread_setconcurrency.c
parent757de559da017957b8d8fdb243ebde70c000cfeb (diff)
downloadglibc-b270b5484067210c84822a28e63be9099e0d112b.tar.gz
Update.
2003-02-15 Ulrich Drepper <drepper@redhat.com> * pthread_setconcurrency.c (pthread_setconcurrency): Fail for negative arguments. * Makefile (tests): Add tst-basic5. * tst-basic5.c: New file. after thread is done. If then zero, call exit(0).
Diffstat (limited to 'nptl/pthread_setconcurrency.c')
-rw-r--r--nptl/pthread_setconcurrency.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nptl/pthread_setconcurrency.c b/nptl/pthread_setconcurrency.c
index f65a174d41..8cf1507131 100644
--- a/nptl/pthread_setconcurrency.c
+++ b/nptl/pthread_setconcurrency.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <errno.h>
#include "pthreadP.h"
@@ -28,6 +29,9 @@ int
pthread_setconcurrency (level)
int level;
{
+ if (level < 0)
+ return EINVAL;
+
__concurrency_level = level;
/* XXX For ports which actually need to handle the concurrency level