From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 2885C385740A; Fri, 9 Jul 2021 22:21:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2885C385740A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: H.J. Lu To: glibc-cvs@sourceware.org Subject: [glibc] support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) X-Act-Checkin: glibc X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: 5d98a7dae955bafa6740c26eaba9c86060ae0344 X-Git-Newrev: 28d07380c2ae5786e242be336ccc1c9e3111f3fa Message-Id: <20210709222127.2885C385740A@sourceware.org> Date: Fri, 9 Jul 2021 22:21:27 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2021 22:21:27 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=28d07380c2ae5786e242be336ccc1c9e3111f3fa commit 28d07380c2ae5786e242be336ccc1c9e3111f3fa Author: H.J. Lu 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 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