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: "Simon Marchi (Code Review)" X-Patchwork-Id: 35837 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); }