about summary refs log tree commit diff
path: root/nptl/pthread_setconcurrency.c
diff options
context:
space:
mode:
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