From patchwork Tue Nov 12 19:05:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1193775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106966-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ypWV3Q3X"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47CHHv3mfcz9sNT for ; Wed, 13 Nov 2019 06:05:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:message-id:subject:references :reply-to:mime-version:content-transfer-encoding:content-type; q=dns; s=default; b=fYPQyDGMGGO6Wh/b9snaC4xLyK4T45G3Rha35/mA+Cl Zia9MmIOgYRYyelH9dcznO6j7k1jE9VYw7yFIxWJ9GLYs9berDaYfjo/e4iiy5cG 3w9azkyuP8jgSyXXTVk4/6GITY/H1tIxTTgPv3F9bMJ3CxjDQZJUkBH4TwIEkRRk = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:message-id:subject:references :reply-to:mime-version:content-transfer-encoding:content-type; s=default; bh=3NBuXNjmygms6/UiVY0RxAP2czk=; b=ypWV3Q3XXKwk2Y1J6 F8UnsRMXvZA1Bq/yAmU8JXLGvG+iTgfsBIo1yEEZ+smqTPsqksFq5TrZMZ/nj8Oq tjCpn1uFzWRm81gN75RGXC735AtsiB+IpQX1qYXBSW3knrBEY+6uh/rjACgzTUhX NayjuyTwsnKsSOfNoA70gTeuh8= Received: (qmail 29730 invoked by alias); 12 Nov 2019 19:05:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 29719 invoked by uid 89); 12 Nov 2019 19:05:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io X-Gerrit-PatchSet: 1 Date: Tue, 12 Nov 2019 14:05:03 -0500 From: "Florian Weimer (Code Review)" To: libc-alpha@sourceware.org Cc: Florian Weimer Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] support: Fix support_set_small_thread_stack_size to build on Hurd X-Gerrit-Change-Id: Ifacc888ef86731c2639721b0932ae59583bd6b3e X-Gerrit-Change-Number: 620 X-Gerrit-ChangeURL: X-Gerrit-Commit: 388dda5b20a1d578373c0acd728528753049819d References: Reply-To: fweimer@redhat.com, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/620 ...................................................................... support: Fix support_set_small_thread_stack_size to build on Hurd PTHREAD_STACK_MIN comes from , so include it explicitly. However, it is not defined on Hurd, so compensate for that as well. Built on x86_64-linux-gnu, i686-linux-gnu, i686-gnu. Change-Id: Ifacc888ef86731c2639721b0932ae59583bd6b3e Reviewed-by: Christian Brauner --- M support/support_set_small_thread_stack_size.c 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/support/support_set_small_thread_stack_size.c b/support/support_set_small_thread_stack_size.c index 23189fd..32954ec 100644 --- a/support/support_set_small_thread_stack_size.c +++ b/support/support_set_small_thread_stack_size.c @@ -16,9 +16,9 @@ License along with the GNU C Library; if not, see . */ +#include #include #include -#include void support_set_small_thread_stack_size (pthread_attr_t *attr) @@ -26,5 +26,10 @@ /* Some architectures have too small values for PTHREAD_STACK_MIN which cannot be used for creating threads. Ensure that the stack size is at least 256 KiB. */ - xpthread_attr_setstacksize (attr, MAX (256 * 1024, PTHREAD_STACK_MIN)); + size_t stack_size = 256 * 1024; +#ifdef PTHREAD_STACK_MIN + if (stack_size < PTHREAD_STACK_MIN) + stack_size = PTHREAD_STACK_MIN; +#endif + xpthread_attr_setstacksize (attr, stack_size); }