From: H.J. Lu Date: Fri, 9 Jul 2021 21:17:04 +0000 (-0700) Subject: support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) X-Git-Tag: glibc-2.34~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28d07380c2ae5786e242be336ccc1c9e3111f3fa;p=thirdparty%2Fglibc.git support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) since the constant MINSIGSTKSZ used in glibc build may be too small. Reviewed-by: Carlos O'Donell --- diff --git a/support/support_stack_alloc.c b/support/support_stack_alloc.c index 03494dd1852..b05ae08968b 100644 --- a/support/support_stack_alloc.c +++ b/support/support_stack_alloc.c @@ -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