enforce stack size min in pthread_attr_setstacksize
authorRich Felker <dalias@aerifal.cx>
Fri, 4 Mar 2011 05:59:14 +0000 (00:59 -0500)
committerRich Felker <dalias@aerifal.cx>
Fri, 4 Mar 2011 05:59:14 +0000 (00:59 -0500)
src/thread/pthread_attr_setstacksize.c

index df16b980886e54c2581c4004e811fcc45c17df19..e4de5208eeba54935a881b10b3366ad8df88392d 100644 (file)
@@ -2,7 +2,7 @@
 
 int pthread_attr_setstacksize(pthread_attr_t *a, size_t size)
 {
-       if (size-PAGE_SIZE > SIZE_MAX/4) return EINVAL;
+       if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL;
        a->_a_stacksize = size - DEFAULT_STACK_SIZE;
        return 0;
 }