]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ)
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Jul 2021 21:17:04 +0000 (14:17 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Jul 2021 22:20:55 +0000 (15:20 -0700)
Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) since the constant
MINSIGSTKSZ used in glibc build may be too small.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
support/support_stack_alloc.c

index 03494dd18527cc8ac34c9ebe1f315a7f49737d2d..b05ae08968b20a3501ae92a5fc8ea9eb837eae3b 100644 (file)
@@ -39,10 +39,11 @@ support_stack_alloc (size_t size)
   if (pagesize == -1)
     FAIL_EXIT1 ("sysconf (_SC_PAGESIZE): %m\n");
 
-  /* Always supply at least MINSIGSTKSZ space; passing 0 as size means
-     only that much space.  No matter what the number is, round it up
-     to a whole number of pages.  */
-  size_t stacksize = roundup (size + MINSIGSTKSZ, pagesize);
+  /* Always supply at least sysconf (_SC_MINSIGSTKSZ) space; passing 0
+     as size means only that much space.  No matter what the number is,
+     round it up to a whole number of pages.  */
+  size_t stacksize = roundup (size + sysconf (_SC_MINSIGSTKSZ),
+                             pagesize);
 
   /* The guard bands need to be large enough to intercept offset
      accesses from a stack address that might otherwise hit another