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 Netto X-Patchwork-Id: 24088 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-Google-Smtp-Source: ABhQp+RBg8mvgpknasiAeqwEXRoks5rGrZeBjU2kKwpzCiZqaqUJOyrkkEtp/xMvRWOV6O6r0KjwvQ== 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(-) 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 ();