public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ)
@ 2021-07-09 22:21 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-07-09 22:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=28d07380c2ae5786e242be336ccc1c9e3111f3fa

commit 28d07380c2ae5786e242be336ccc1c9e3111f3fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 9 14:17:04 2021 -0700

    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>

Diff:
---
 support/support_stack_alloc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/support/support_stack_alloc.c b/support/support_stack_alloc.c
index 03494dd185..b05ae08968 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-09 22:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 22:21 [glibc] support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).