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 <carlos@redhat.com>
This commit is contained in:
H.J. Lu 2021-07-09 14:17:04 -07:00
parent 5d98a7dae9
commit 28d07380c2

View 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