about summary refs log tree commit diff
path: root/linuxthreads/attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/attr.c')
-rw-r--r--linuxthreads/attr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c
index 7a099857aa..3a19ddc49b 100644
--- a/linuxthreads/attr.c
+++ b/linuxthreads/attr.c
@@ -146,10 +146,8 @@ int __pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
   /* First round up the guard size.  */
   guardsize = roundup (guardsize, ps);
 
-  /* The current implementation of LinuxThreads allocates 2MB stack space
-     for each thread.  So the maximum guardsize is 2MB - pagesize.  */
-  if (guardsize >= STACK_SIZE - ps)
-    return EINVAL;
+  /* The guard size must not be larger than the stack itself */
+  if (guardsize >= attr->stacksize) return EINVAL;
 
   attr->guardsize = guardsize;