summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2008-06-25 11:07:07 +0000
committerad <ad@NetBSD.org>2008-06-25 11:07:07 +0000
commit403a399142be4969a3813a104e392a2138fa8a26 (patch)
tree2f12f06f23a9688aa89cee5e284a4e4395dac4ab /lib/libpthread
parent39a9e71121b18dc9fe320c4f441a3d1e68289b63 (diff)
pthread_attr_setstacksize: EINVAL if the requested size is less than
sysconf(_SC_THREAD_STACK_MIN).
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread_attr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/pthread_attr.c b/lib/libpthread/pthread_attr.c
index 378c9954e73..d1316508e70 100644
--- a/lib/libpthread/pthread_attr.c
+++ b/lib/libpthread/pthread_attr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_attr.c,v 1.8 2008/04/28 20:23:01 martin Exp $ */
+/* $NetBSD: pthread_attr.c,v 1.9 2008/06/25 11:07:07 ad Exp $ */
/*-
* Copyright (c) 2001,2002,2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_attr.c,v 1.8 2008/04/28 20:23:01 martin Exp $");
+__RCSID("$NetBSD: pthread_attr.c,v 1.9 2008/06/25 11:07:07 ad Exp $");
#include <errno.h>
#include <stdio.h>
@@ -339,6 +339,9 @@ pthread_attr_setstacksize(pthread_attr_t *attr, size_t size)
{
struct pthread_attr_private *p;
+ if (size < sysconf(_SC_THREAD_STACK_MIN))
+ return EINVAL;
+
p = pthread__attr_init_private(attr);
if (p == NULL)
return ENOMEM;