From patchwork Wed Nov 13 13:09:49 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: 1194249 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-107035-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="FHOGkRgm"; 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 47ClMW3wl4z9sNT for ; Thu, 14 Nov 2019 00:09:59 +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:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=lEY/7D+3TXSgRkvV4EJdRtN/sAEoCFo vj65LeVehqnzRuH78dDnmtkurMxbrVUNh8j0foE8+7d7xBgRyOLDBVDtn9FPPpXP G4DdGWyTv3UwFhYfY9vfExOyEyRx6iqqmi1uo11WUYkTLz801p1Ek71gXtRGzutf YMptH+BfbcT4= 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:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=aDtF/Mt3KOXdQ7RGSbZYai27KS4=; b=FHOGk RgmIW4oXBh9G5W9Hxq054MfPTl+JvHLBbbBthrx06KKj/Hf8HTSXjPwdRMg+/lNj amaxre9F/mT4xtaBG2GnA/bEKSRjuc+mcJHnB2GXIhB3kFxK2g6VfG4u1nMNLjfu j8t/c48ccffs78irNWIg2CB5fjCwFfJfKmFSA8= Received: (qmail 124014 invoked by alias); 13 Nov 2019 13:09:54 -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 123957 invoked by uid 89); 13 Nov 2019 13:09:53 -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: 2 Date: Wed, 13 Nov 2019 08:09:49 -0500 From: "Florian Weimer (Code Review)" To: Florian Weimer , Christian Brauner , libc-alpha@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] 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: b8e70d9de5e2affc20aa2a16da115dc489836c20 In-Reply-To: References: Reply-To: fweimer@redhat.com, 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: <20191113130949.927B020AF6@gnutoolchain-gerrit.osci.io> 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); }