From patchwork Wed Nov 13 13:20:15 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: 1194252 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-107037-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="Hlut9zLm"; 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 47ClbZ304Zz9sPZ for ; Thu, 14 Nov 2019 00:20:26 +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:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=pPvvEotm0fNtXfRnlqsCgvfeYNA4bbk dBlhM0R/+QfpG4Klw/ENePEUezMAViH0p4DrKgV8PYEo989+ltf88LgrN4AEBlkc T58kYvay5Rv7qDOTev65elSBefINEwbpt5Q4Nc/nV3uBkrWDYpcq/u1YKCwG1JXD rSSc0gXBE8Sc= 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:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=RJ56GXM7g6DSd1YgCNki9x4qj+Q=; b=Hlut9 zLmYjdkc8s5/OfoYs/hpluhbvg0w/HlMBbE6xs/YAPhxx4F50KhHxGfxuICQz/Gq PFgf2U4CNGPYdnfCTTaTpcjROS16HKyklXS4Nq69v9/Um2nbielxa1AhxrY8bnop +rQ4+/Ehf8GauiB3S9dp+1LMvBxmBx+JOhwxaU= Received: (qmail 9914 invoked by alias); 13 Nov 2019 13:20:20 -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 9904 invoked by uid 89); 13 Nov 2019 13:20:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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: 3 Date: Wed, 13 Nov 2019 08:20:15 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , libc-alpha@sourceware.org Cc: Christian Brauner Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] 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: 02132c0f4c78f77d4a8cdbdea8f02956347e29ab In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, fweimer@redhat.com, libc-alpha@sourceware.org, christian.brauner@ubuntu.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191113132015.34F2F20AF6@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. 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(-) Approvals: Christian Brauner: Looks good to me, approved 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); }