From patchwork Tue Feb 27 00:12:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 878240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-90647-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="qYXEYg1T"; 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 3zqzfW5CJsz9s0t for ; Tue, 27 Feb 2018 11:12:35 +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:from:to:cc:subject:date:message-id; q=dns; s= default; b=LIVvE8wXe3NoT+mxkVzlevQUUKPaYxv70apbkfnmM2pUM82B8K7l2 8cOE7cqc7fvE1PeJXquxGNmEcUMNb4BVaqE5JCcUWrpUEMxV6G0mB5+FoY4xnS4h n5z4TgnCBbt8bc3D7MGPPki19K5JN4sxRer9f48VQ5GamiMsGZ1C6A= 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:from:to:cc:subject:date:message-id; s=default; bh=ke1gXSPIQi3gIe9ksWvxhBgx/Zw=; b=qYXEYg1Tl9gDe5QCBZuyrmvs1Vvf chOH7DAhdN0a/4gfe4zfJytcNF9qdpEkgzvm4Lq1GkN7VcdGk/HwUid3/HCeEJuX XhD2WcIz38RDBXUUnK3TmMQG3/gbgI2YnloPZxvifZ9EYljsXQjQxy0GXwQM048w o+iHn9DtoWOQ1BU= Received: (qmail 15971 invoked by alias); 27 Feb 2018 00:12:30 -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 15961 invoked by uid 89); 27 Feb 2018 00:12:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, SPF_NEUTRAL, URIBL_RED autolearn=ham version=3.3.2 spammy=thoroughly, Hx-languages-length:2960, detached, *tf X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd,commited] hurd: fix gai_misc build Date: Tue, 27 Feb 2018 01:12:23 +0100 Message-Id: <20180227001223.27437-1-samuel.thibault@ens-lyon.org> * sysdeps/mach/hurd/gai_misc.h: New file. --- ChangeLog | 1 + sysdeps/mach/hurd/gai_misc.h | 67 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 sysdeps/mach/hurd/gai_misc.h diff --git a/ChangeLog b/ChangeLog index 5ef9814516..ffa7532ff7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ (thread_attr_compare): Move function to... [!defined DELAYTIMER_MAX] (DELAYTIMER_MAX): Define to INT_MAX. * sysdeps/nptl/timer_routines.h: ... new header. + * sysdeps/mach/hurd/gai_misc.h: New file. 2018-02-26 Joseph Myers diff --git a/sysdeps/mach/hurd/gai_misc.h b/sysdeps/mach/hurd/gai_misc.h new file mode 100644 index 0000000000..7804139baa --- /dev/null +++ b/sysdeps/mach/hurd/gai_misc.h @@ -0,0 +1,67 @@ +/* Copyright (C) 2006-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +#define gai_start_notify_thread __gai_start_notify_thread +#define gai_create_helper_thread __gai_create_helper_thread + +extern inline void +__gai_start_notify_thread (void) +{ + sigset_t ss; + sigemptyset (&ss); + int sigerr __attribute__ ((unused)); + sigerr = pthread_sigmask (SIG_SETMASK, &ss, NULL); + assert_perror (sigerr); +} + +extern inline int +__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), + void *arg) +{ + pthread_attr_t attr; + + /* Make sure the thread is created detached. */ + pthread_attr_init (&attr); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + + /* The helper thread needs only very little resources. */ + (void) pthread_attr_setstacksize (&attr, 0x10000); + + /* Block all signals in the helper thread. To do this thoroughly we + temporarily have to block all signals here. */ + sigset_t ss; + sigset_t oss; + sigfillset (&ss); + int sigerr __attribute__ ((unused)); + sigerr = pthread_sigmask (SIG_SETMASK, &ss, &oss); + assert_perror (sigerr); + + int ret = pthread_create (threadp, &attr, tf, arg); + + /* Restore the signal mask. */ + sigerr = pthread_sigmask (SIG_SETMASK, &oss, NULL); + assert_perror (sigerr); + + (void) pthread_attr_destroy (&attr); + return ret; +} + +#include_next