From patchwork Mon Feb 12 12:42:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 128016 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3171296ljc; Mon, 12 Feb 2018 04:42:45 -0800 (PST) X-Google-Smtp-Source: AH8x224Hy7cDowr0GLLRkzEi5ldVOOuFeZ2pJ3Mc9IYpKsEl8BJVtS7l4HYVKcot9Ad0b0UHPF9j X-Received: by 10.99.189.82 with SMTP id d18mr9154908pgp.41.1518439364872; Mon, 12 Feb 2018 04:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518439364; cv=none; d=google.com; s=arc-20160816; b=EL7BAC6itrl7haLzIVIO8T+RAh3IEiifbkr7vZflSzaOeLsL0ent+rxAvwTOfKm3Pd kbooXUHji01W6rPWked4KKGAOPuwdCuBSPHqXkTmP7VCqRMvEn7xBT94aAxJ2pG4d2xD MN+XB8UV3gyhdS81Bogmyodm1PM1WjprlMyWuJvylgYNmanmvbUWfpjeo7SZsVEMBYFf aI4RlrBN/1ad7Dop3C6XceKX0x/Y47pJZH8rSmaS+Q4bvCt3DSNvnek12gK9+CoVS5Ua DINHeNXhyeQXVLS35/CuN+6xio8Ockv1VI4yu4ZeWoQ+MOnCatZb6EE8z3fx/nJORP9Z eLUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=HSBUXbnH2wAUl6k4OVzH0x6XePO2Mj54JpwbEjFrzxc=; b=sOIJ1uTvBy6uHeF5S4OGSdXotfssNwaIfz8K8HdKd+oxwJMS2SU0CbjvRBwM6PbOQb vx3yhdKRytw8pVVqQeXMbbxKXqMYgkDtt+H7IktWlWkMVMHEtSPud1HXG1F9kqpKXL19 fdgGLM6A2BN8nFOmNyiLqsNMO5ty2W1KiKBidGP/t3J0IewSLstOu/o4Gl8mqEfgXEfm +4d4T3LOwhUBxoGAErmoss+jnNV8Cy4WRVKuBy5UN4UU88PocMG6pl9yVI6Pc1oXBdtA AjXnP/fv2vLlK4Z0fjVeac+b25Z1LC345yiKFyM0nJUXKBSDRaX9gZTJdnJZqp0p8ZrO 3uvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=gb+M2641; spf=pass (google.com: domain of libc-alpha-return-90257-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-90257-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g24si3371319pfd.140.2018.02.12.04.42.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 04:42:44 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-90257-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=gb+M2641; spf=pass (google.com: domain of libc-alpha-return-90257-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-90257-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:date:message-id; q=dns; s= default; b=AWmMv/SJkKmw2P13b8SfJC3p2G9BhB4uv5ddWUykWi075Bb1QKjvs KbEJDApTvSJYRkIyR0lsbNEDQBHhx7clWBdt/qGWk/CUrP9Sq6o7B2WI209oYP/x bh8gpaTMBs15WlnkRHeYLozSXtvCO4TJAEY+hDvzm29iWnIbcxuy8Q= 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:subject:date:message-id; s=default; bh=mIKTUvqCrkrtl1CgK72zmF7nJHA=; b=gb+M2641AEu3yO7Xt+37uh07GRN2 47+aarQUpw1dfig8cveGN0LFelY/uLoeQKk2wHNCON7hC9zRXWX7uRBumaOOsOJ1 TxoGXo+XvdbA1teFIiY76L+J0xvVRFbAAbe2uRvo59TKjhx419ZlloAiePIjGa1V 2B/qf1YtkZgmVIY= Received: (qmail 51341 invoked by alias); 12 Feb 2018 12:42:35 -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 51331 invoked by uid 89); 12 Feb 2018 12:42:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:__inter X-HELO: mail-qt0-f194.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=HSBUXbnH2wAUl6k4OVzH0x6XePO2Mj54JpwbEjFrzxc=; b=Hp2gUvnYD/WplzsrfQMPELzteLSnpvJqZpfTBWh2ih1EWfQdMdGpN89pBe++KZ/rIY WnTK0Hbl9tC64Wz8YxtVH6atGx/KYiXKcG4vB7/x4pHWUWtKMMY+4nT6PClRhgviJw4e dA66g5k+K3eW76PxMmvNHj1vMZZHhW6f4oLy449lrOB/3VSlmC+GcnyEpuW3BvKi691d Xg+jg5kgRcWKh9MlS0x9Gu0bz1SUkbrz1YfM4QLwUclJ/yFzqCDpwa1l00Flw+Qp/nNZ 8/SIfrgoOBPddkk2MdS4nZaH8ZHZmDs2MxfxILIw42cVW/pokmfJaZ5rxQtpF/1N33ya mTSw== X-Gm-Message-State: APf1xPBSVP9vFDYjnncW11a9SjKTdnp5GSVXn475YMzKRFYJPkW47ktc HAuExgGc5aKwwDma/3Z/xg3D9Teu3fM= X-Received: by 10.200.54.151 with SMTP id a23mr9570371qtc.123.1518439350647; Mon, 12 Feb 2018 04:42:30 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v4 1/4] Rename nptl-signals.h to internal-signals.h Date: Mon, 12 Feb 2018 10:42:22 -0200 Message-Id: <1518439345-6013-1-git-send-email-adhemerval.zanella@linaro.org> Changes from previous version: - Fixed documentation issues pointed out by Rical Jasan. -- This patch renames the nptl-signals.h header to internal-signals.h. On Linux the definitions and functions are not only NPTL related, but used for other POSIX definitions as well (for instance SIGTIMER for posix times, SIGSETXID for id functions, and signal block/restore helpers) and since generic functions will be places and used in generic implementation it makes more sense to decouple it from NPTL. Checked on x86_64-linux-gnu. * sysdeps/nptl/nptl-signals.h: Move to ... * sysdeps/generic/internal-signals.h: ... here. Adjust internal comments. * sysdeps/unix/sysv/linux/internal-signals.h: Add include guards. (__nptl_is_internal_signal): Rename to __is_internal_signal. (__nptl_clear_internal_signals): Rename to __clear_internal_signals. * sysdeps/unix/sysv/linux/raise.c: Adjust nptl-signal.h to include-signals.h rename. * nptl/pthreadP.h: Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Call __is_internal_signal instead of __nptl_is_internal_signal. Signed-off-by: Adhemerval Zanella --- ChangeLog | 14 ++++++++++++++ nptl/pthreadP.h | 2 +- .../{nptl/nptl-signals.h => generic/internal-signals.h} | 7 +------ .../sysv/linux/{nptl-signals.h => internal-signals.h} | 16 ++++++++++------ sysdeps/unix/sysv/linux/raise.c | 2 +- sysdeps/unix/sysv/linux/spawni.c | 2 +- 6 files changed, 28 insertions(+), 15 deletions(-) rename sysdeps/{nptl/nptl-signals.h => generic/internal-signals.h} (74%) rename sysdeps/unix/sysv/linux/{nptl-signals.h => internal-signals.h} (89%) -- 2.7.4 diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 583515f..075530c 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include /* Atomic operations on TLS memory. */ diff --git a/sysdeps/nptl/nptl-signals.h b/sysdeps/generic/internal-signals.h similarity index 74% rename from sysdeps/nptl/nptl-signals.h rename to sysdeps/generic/internal-signals.h index e1275c7..01e5b75 100644 --- a/sysdeps/nptl/nptl-signals.h +++ b/sysdeps/generic/internal-signals.h @@ -1,4 +1,4 @@ -/* Special use of signals in NPTL internals. Stub version. +/* Special use of signals internally. Stub version. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -15,8 +15,3 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ - -/* This file can define the macros SIGCANCEL, SIGTIMER, and SIGSETXID to - signal numbers reserved by libpthread for those internal purposes. - - Note that some code presumes SIGTIMER is the same as SIGCANCEL. */ diff --git a/sysdeps/unix/sysv/linux/nptl-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h similarity index 89% rename from sysdeps/unix/sysv/linux/nptl-signals.h rename to sysdeps/unix/sysv/linux/internal-signals.h index e789198..e007372 100644 --- a/sysdeps/unix/sysv/linux/nptl-signals.h +++ b/sysdeps/unix/sysv/linux/internal-signals.h @@ -1,4 +1,4 @@ -/* Special use of signals in NPTL internals. Linux version. +/* Special use of signals internally. Linux version. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef __INTERNAL_SIGNALS_H +# define __INTERNAL_SIGNALS_H + #include #include @@ -35,17 +38,16 @@ /* Return is sig is used internally. */ static inline int -__nptl_is_internal_signal (int sig) +__is_internal_signal (int sig) { - return (sig == SIGCANCEL) || (sig == SIGTIMER) || (sig == SIGSETXID); + return (sig == SIGCANCEL) || (sig == SIGSETXID); } /* Remove internal glibc signal from the mask. */ static inline void -__nptl_clear_internal_signals (sigset_t *set) +__clear_internal_signals (sigset_t *set) { __sigdelset (set, SIGCANCEL); - __sigdelset (set, SIGTIMER); __sigdelset (set, SIGSETXID); } @@ -66,7 +68,7 @@ static inline int __libc_signal_block_app (sigset_t *set) { sigset_t allset = SIGALL_SET; - __nptl_clear_internal_signals (&allset); + __clear_internal_signals (&allset); INTERNAL_SYSCALL_DECL (err); return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &allset, set, _NSIG / 8); @@ -83,3 +85,5 @@ __libc_signal_restore_set (const sigset_t *set) /* Used to communicate with signal handler. */ extern struct xid_command *__xidcmd attribute_hidden; + +#endif diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c index cb98f90..b05eae2 100644 --- a/sysdeps/unix/sysv/linux/raise.c +++ b/sysdeps/unix/sysv/linux/raise.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include int raise (int sig) diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index 6b699a4..0391b9b 100644 --- a/sysdeps/unix/sysv/linux/spawni.c +++ b/sysdeps/unix/sysv/linux/spawni.c @@ -144,7 +144,7 @@ __spawni_child (void *arguments) } else if (sigismember (&hset, sig)) { - if (__nptl_is_internal_signal (sig)) + if (__is_internal_signal (sig)) sa.sa_handler = SIG_IGN; else {