From patchwork Fri Nov 3 21:40:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 117966 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp214424qgn; Fri, 3 Nov 2017 14:42:14 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Sbsg9jcsrB07na2pRIqRDs5CYOfMja2ooswKL+H0MkRL7xEQzIcm9zj7SUUzOWzIC64XE9 X-Received: by 10.101.85.72 with SMTP id t8mr8431265pgr.211.1509745334186; Fri, 03 Nov 2017 14:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509745334; cv=none; d=google.com; s=arc-20160816; b=zNPjGiV4/bhku+YDgmeaYsXD0kK+WVjKwqItpqD7X7O44RByEsBBPt914ltYCVje6G 7up1YlA8SIIE0i2kfGZWD+dJiFdkN9xZdAffaeWpOJuDxfK+zhyO/e6hmL772SRtIVsc YtaVtA0NXApdBK4KF57r7PdiV/8DRpDBk6f3mh3hKP9cDkhoy/g6q/r/6Ql74ULw3MF3 l6IBwV5nFn2fwjm+xWiQDqzwgCGVFfbZNBb+/VTeEqUlGE23eOmdLm2WztoHYCjCpcKX S3QpJDXzweTowZ8TcxTSqf/nS1kZFC+Ayj9ngyvMyiJ6Y3F9KRZpleCZSGI68Wwr8L5Z RzUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to: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=Fxk3q4PdSurYhS8dg5BaTOPzydo7t6MeS5ZLKEyatv4=; b=T801UhqFlfR3LkZaADwRhQFCd1uPNAkTqBlNwzo8wsrDDzDycNxQrdeVyoZfEe4lEa 32JylxmTIrL2XYqEcmgT83RlP8bwKEWN4ausiR7BzQFb/b8c7Q0vIfWUf2ihTITvG6IQ e/K2rS9aTAtX88geIcmIFUrg/hiBk+mLvwKR4vIXgu8dikwuANYxPmvMc8xGxYmiKtLb 8flpovzvRViQIkGaHT6a13zFzkQONeXD8aCwQw69bl4WoEUFeM7WgoAaE6EULrQUypNX uOJbYjq6Jrgpsxcalmg2KFGEnQsEYhuOo45gfA8MCNVr3EkdnQxb9prJn+SiCuA4DVl1 22Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Dd0FZfEq; spf=pass (google.com: domain of libc-alpha-return-86731-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86731-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 n11si4922407pls.465.2017.11.03.14.42.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 14:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86731-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=Dd0FZfEq; spf=pass (google.com: domain of libc-alpha-return-86731-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86731-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:in-reply-to :references; q=dns; s=default; b=vPajd1jvA1E4SmFt7WCI0YTANFSRM94 wO5LJHVb666HJWFzwen+egXu19PQBNjMK3qIDbRL1CcXAVVZdz7Niur7nh4iqrW3 XQRFZxYb+7mxSRbJRhPjzJ803nPYpP2UkX49s2uj8UPO25Zdnx5ZJ95ndX6CwcUJ 4mhhS1Joqn1c= 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:in-reply-to :references; s=default; bh=jJekoEh3uE9vWBJlfczF9TSaqFk=; b=Dd0FZ fEqY2TPoFjGt0x+V7BCjaINCOXJ47HLnSNRpY3l1EmDP5DbQB9DPfTV/E8I/0bWR SV7ZJbzoVwGzl3lfggYiIz54PhI2oIopbcA2YzAwQyGe5WN9FPvjpzfkIrRF7LCB P8WAUUe0i5U64YW0SVKjnVRmNxZrK0/lSOz7Mw= Received: (qmail 38368 invoked by alias); 3 Nov 2017 21:41: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 38341 invoked by uid 89); 3 Nov 2017 21:41:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f195.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:in-reply-to :references; bh=Fxk3q4PdSurYhS8dg5BaTOPzydo7t6MeS5ZLKEyatv4=; b=fvRkCXhLa28h+eDPurFP9Pn441rM++yzdUPTf+CeDM3x+BTiGSShowhEJk1+Z6UZbp ++OaUFKrIu9qS6kicuu7Qd/45YX/HWRvObjeO302UJkaBxtEkJQ9fLK3NxTZ5V2Yjj0D CPp/SDrEdN7u6S3GF8GYesX1J4NnCZpdKYLy7LIWfpYnwkSstzjesoMnc4c4KHET2ziY RLa1sNwbDYIjANZPAbCL1+sMof+QuuHuZfrIgyKfZIcLu9Zk0wDrN3fBGJHcu0pk7mu0 F67beoI5mgJ4LO3r2XYxcg/q5ktvP57RcOBRyaJmfMqwINOhsMl/Rl4zIDNMscvCRIIC TYMA== X-Gm-Message-State: AMCzsaXI+E9eZBwvEh0NCMDn0VF1Kc9kql0qmgCPnKlMg8DY3isNBNkK SlNOzQLaRpJ86IsO1UBnOWnjO/YtBbc= X-Received: by 10.200.24.184 with SMTP id s53mr12217280qtj.48.1509745265079; Fri, 03 Nov 2017 14:41:05 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 6/6] Cleanup sigpause implementation Date: Fri, 3 Nov 2017 19:40:49 -0200 Message-Id: <1509745249-11404-6-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1509745249-11404-1-git-send-email-adhemerval.zanella@linaro.org> References: <1509745249-11404-1-git-send-email-adhemerval.zanella@linaro.org> This patch simplify sigpause by remobing the single thread optimization since it will be handled already by the __sigsuspend call. Checked on x86_64-linux-gnu. * sysdeps/posix/sigpause.c (do_sigpause): Remove. (__sigpause): Rely on __sigsuspend to implement single thread optimization. Signed-off-by: Adhemerval Zanella --- ChangeLog | 4 ++++ sysdeps/posix/sigpause.c | 25 +++++-------------------- 2 files changed, 9 insertions(+), 20 deletions(-) -- 2.7.4 diff --git a/sysdeps/posix/sigpause.c b/sysdeps/posix/sigpause.c index 9038ed3..706195c 100644 --- a/sysdeps/posix/sigpause.c +++ b/sysdeps/posix/sigpause.c @@ -19,15 +19,13 @@ #include #include #include /* For NULL. */ -#include #undef sigpause #include +#include -/* Set the mask of blocked signals to MASK, - wait for a signal to arrive, and then restore the mask. */ -static int -do_sigpause (int sig_or_mask, int is_sig) +int +__sigpause (int sig_or_mask, int is_sig) { sigset_t set; @@ -46,21 +44,6 @@ do_sigpause (int sig_or_mask, int is_sig) to do anything here. */ return __sigsuspend (&set); } - -int -__sigpause (int sig_or_mask, int is_sig) -{ - if (SINGLE_THREAD_P) - return do_sigpause (sig_or_mask, is_sig); - - int oldtype = LIBC_CANCEL_ASYNC (); - - int result = do_sigpause (sig_or_mask, is_sig); - - LIBC_CANCEL_RESET (oldtype); - - return result; -} libc_hidden_def (__sigpause) /* We have to provide a default version of this function since the @@ -87,3 +70,5 @@ __xpg_sigpause (int sig) return __sigpause (sig, 1); } strong_alias (__xpg_sigpause, __libc___xpg_sigpause) + +LIBC_CANCEL_HANDLED ();