From patchwork Thu Aug 3 13:11:07 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: 109333 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp763967qge; Thu, 3 Aug 2017 06:13:21 -0700 (PDT) X-Received: by 10.99.112.86 with SMTP id a22mr1583827pgn.151.1501766001850; Thu, 03 Aug 2017 06:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501766001; cv=none; d=google.com; s=arc-20160816; b=Wge+TxzyOL+EYPXtMO7CU9e0KCISOegx+rqyOxqcWF5xVHsTwuZ0VMryWh6F0U1GIA EWI0KxaYlYVVu7Yjz/EsP/xQP/F7K94aQjVtVroao2zVkY3AFYpX4p/EWY/M9B3q0VZF UFaXZOUeG/LBJ6hce8CV7r0Q2vB19ih3x7X+7ow6bizh/HJtd1cJvUPg0i6P0skqs/d6 SeimG/1lze4sricM9tzZe0Sx+gA0hkFgFHggTK2pUkvyIi99yCVvmbRPANpOtm3B1F5a 3yu9xFFaLICSwPTE5+yuNQU5ijZ7Fvt6dJI9LLOliFvXKzyhR+Zgs3WHTHJx7ypxU7MK RZbQ== 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=2zpEOtSirKItIu0IaIYShNwKUPNOdmPZByxNCz9RXv8=; b=qllinKKtNY7w4mqK4loWq7HZ0fO1oHfbXJr2Hh7b3afpZo2MlFLVLzOxfYJnCbyA5F 3UwYNcAParotB3ZyZn21YnsPaWIy6ZMpPcwf1hrin9Lz1pY+fzAB9Qr4mC6aeIo1UF+w GbsMjV1V2rj2DGhZyB2PkopzooytD3yRl/DjR+P++X9T4KGtUkm/CdxHmyshC+hGLix0 o++q6HepXM+4ZVHSnzg3fx0YeFMpSgKX4JOx9LTqqa9pPsanH2078o+ULkHqc02bXGig cHXPabPZf3LmGZHHO38L9RAyE8pfM/C/Xm0aHWpfn6hi8aRfMhFiqihRMVp09LdVMvzp bCmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.b=D9UaDsKn; spf=pass (google.com: domain of libc-alpha-return-82687-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-82687-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 a14si23036959pll.761.2017.08.03.06.13.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 06:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-82687-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.b=D9UaDsKn; spf=pass (google.com: domain of libc-alpha-return-82687-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-82687-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=fwnyFnLkerDhMNJOSwkpcIdGjIeytWB PhjpQTm/rdJpiBjTgcE7x6E3axHtGgOyGalRG8C+wFb9egPFsjzw0dcbfZwLbGOQ TUg7FnA0AIfuAB0bFm+bw0Whb6QCKDxfmFLAFq+zIz5pbDb+Dp5m60bysGZ6j3bb 1huNnAx/w77o= 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=tzQVHcYJYiFp93dVm9yU8K1nJDA=; b=D9UaD sKnNdCfUUjkXkdfCBVhpzBhrso8c5iOBWZgdo1OXhDMbZV3CpIcEukOUQaSA9+Yu 5mhggv0ZxiUTndtYzNttaXZjhMr9XapcvyqYAxoffQrA8Il5+CuWOhCSFrge3Suh qHGp7QSrml4e0fjcd07/laYlt1pP19s+lCxeZQ= Received: (qmail 61796 invoked by alias); 3 Aug 2017 13:11:55 -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 61729 invoked by uid 89); 3 Aug 2017 13:11:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f170.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=2zpEOtSirKItIu0IaIYShNwKUPNOdmPZByxNCz9RXv8=; b=Jq83KIs5Yk2kMtP+06ykz6uslhFPdGTIXcJGEMzAM4QrakxfeV0w37ZL7DepQgRkx6 RMyO7mcZIjAcKbotzLmuXIP6vwwi/3ivEb7JziP7Xai3P5zbHqkgLFXEHrwjbDnItjuQ zLAXz4UCwtdXizTII5oHpDOCQXvFSJdBruwqplkMnodfn9SKWXQA+XEZ+8nwR4QULvxZ Fikv2DncNuaINdxmczkUnWTkgyRZr+y8EaxqAD5bXRQnJjqVczDd6RrzYuRNjVJjGuj1 xim+PVJe1CexDTmwN2IS5rd6j3SY/Ubhvr0KwPHLc21b8t2Zlp2piwpeNd3hrF84h7GU UiVw== X-Gm-Message-State: AHYfb5iQ+1jUi02oxc8ZyoSQhivrwqq7InNGzNqoE2v9wDGoz22s2pSu Z6Lkx011T4HY6tHkFpNLjg== X-Received: by 10.55.34.67 with SMTP id i64mr2487627qki.128.1501765906843; Thu, 03 Aug 2017 06:11:46 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 07/14] Consolidate non cancellable fcntl call Date: Thu, 3 Aug 2017 10:11:07 -0300 Message-Id: <1501765874-6201-8-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1501765874-6201-1-git-send-email-adhemerval.zanella@linaro.org> References: <1501765874-6201-1-git-send-email-adhemerval.zanella@linaro.org> This patch consolidates all the non cancellable fcntl calls to use the __fcntl_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Since its prototype is already defined at internal fcntl.h header, it is removed from not-cancel.h one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * login/utmp_file.c (timeout_handler): Replace fcntl_not_cancel with __fcntl_nocancel. * sysdeps/generic/not-cancel.h (fcntl_not_cancel): Remove macro. * sysdeps/unix/sysv/linux/not-cancel.h (fcntl_not_cancel): Likewise. --- ChangeLog | 5 +++++ login/utmp_file.c | 4 ++-- sysdeps/generic/not-cancel.h | 2 -- sysdeps/unix/sysv/linux/not-cancel.h | 4 ---- 4 files changed, 7 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/ChangeLog b/ChangeLog index fbf0c6a..e1df1c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2017-08-02 Adhemerval Zanella + * login/utmp_file.c (timeout_handler): Replace fcntl_not_cancel with + __fcntl_nocancel. + * sysdeps/generic/not-cancel.h (fcntl_not_cancel): Remove macro. + * sysdeps/unix/sysv/linux/not-cancel.h (fcntl_not_cancel): Likewise. + * gmon/gmon.c (write_hist): Replace writev_not_cancel_no_status with __writev_nocancel_nostatus. (write_call_graph): Likewise. diff --git a/login/utmp_file.c b/login/utmp_file.c index 68e00f2..d410b6c 100644 --- a/login/utmp_file.c +++ b/login/utmp_file.c @@ -81,7 +81,7 @@ static void timeout_handler (int signum) {}; memset (&fl, '\0', sizeof (struct flock)); \ fl.l_type = (type); \ fl.l_whence = SEEK_SET; \ - if (fcntl_not_cancel ((fd), F_SETLKW, &fl) < 0) + if (__fcntl_nocancel ((fd), F_SETLKW, &fl) < 0) #define LOCKING_FAILED() \ goto unalarm_return @@ -89,7 +89,7 @@ static void timeout_handler (int signum) {}; #define UNLOCK_FILE(fd) \ /* Unlock the file. */ \ fl.l_type = F_UNLCK; \ - fcntl_not_cancel ((fd), F_SETLKW, &fl); \ + __fcntl_nocancel ((fd), F_SETLKW, &fl); \ \ unalarm_return: \ /* Reset the signal handler and alarm. We must reset the alarm \ diff --git a/sysdeps/generic/not-cancel.h b/sysdeps/generic/not-cancel.h index e3ed0e6..cf84550 100644 --- a/sysdeps/generic/not-cancel.h +++ b/sysdeps/generic/not-cancel.h @@ -36,8 +36,6 @@ __write (fd, buf, n) #define __writev_nocancel_nostatus(fd, iov, n) \ (void) __writev (fd, iov, n) -#define fcntl_not_cancel(fd, cmd, val) \ - __fcntl (fd, cmd, val) # define waitpid_not_cancel(pid, stat_loc, options) \ __waitpid (pid, stat_loc, options) #define pause_not_cancel() \ diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h index 419a3fa..8f567d3 100644 --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -72,10 +72,6 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt) INTERNAL_SYSCALL_CALL (writev, err, fd, iov, iovcnt); } -/* Uncancelable fcntl. */ -#define fcntl_not_cancel(fd, cmd, val) \ - __fcntl_nocancel (fd, cmd, val) - /* Uncancelable waitpid. */ #define __waitpid_nocancel(pid, stat_loc, options) \ INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)