From patchwork Tue Jul 4 19:53:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 107018 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1361556qge; Tue, 4 Jul 2017 12:55:25 -0700 (PDT) X-Received: by 10.84.229.6 with SMTP id b6mr17793211plk.247.1499198124964; Tue, 04 Jul 2017 12:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499198124; cv=none; d=google.com; s=arc-20160816; b=xxcqL25stOoC1uRdtBuMSSKvBhfIvE4Zkwvf6s2T2+daMStVRAIVq/W3B1cBcrdqUs eEkIiwXsg8GkoibapBvq38UmBLY4X67bHz0qEBM975tFooZZpAKdYcx3Qh9l4NZobhuJ hZKyzQbFuInIIFR4YEmNmX5Nv3I7w+DpXics4b6nwVsQPHCB9KHKrXtIdW8OYylfJkeZ HNnLf8Q9HM0B3zLrm9GMNcmAz6gypTiqfH5mUwsZb4y8VnkOYk0Xox6wslpTbtzxQSAv aMgvx4eaHIk3RNaVnlI59VNgbH+lltYNij/0EZlWVjS3AJm863DwyqRNSuyq7C5eoner c9Sw== 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=kVuRia8YFXoEvWTz1XsIZ+ncjsiGV69O6x/xBemu83s=; b=jVD8p341Q8PwdaPPr/Ah3IzTRNrbkXszXlke4u48v1irOlXho4FqbiHnl83klv2r7J hYRLX8lGG8SDGIX72UuCRJ30NaN2aSu4jij/N+Hdonk1lAFYS6fETorQt5CzrjErzSJr mUFO2cqMsYW16zjlaeua62kut6x4aOXWSCZgsrk1b+z5jzTGdfiWJpIyN1jQjMxzPHww 6aJ48J1tFYGTNXimptBD/sUx5h1EJ5WtCKkl9cEDL88uoTkPN26OcRw420qAevC0JukF e0KxxmdQPiWgRndDxX50wbKTS1Q86G2la6yl9/qoSmTB4tut/aLCNt6NnrLjSk552aBd tmTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.b=qFA6nIMR; spf=pass (google.com: domain of libc-alpha-return-81666-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-81666-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 o4si14498998pgd.352.2017.07.04.12.55.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 12:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-81666-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=qFA6nIMR; spf=pass (google.com: domain of libc-alpha-return-81666-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-81666-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=oANd3MYMeVBaKNhvSWTt6LE7YP1hjhB vdadwpVRN9LcBlmpN3twmMmxbEEvMICYlhP/7k2j2+2+aqLyoZusxyLsBfGwPDJJ kCtiHy4bkkEJSOS1YnFeztagOUwjtwKKnah6qTPcjoqfzFIidWfidvuKdmHgmMoP wWBVItsT096c= 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=SAquF5gRfceM4z91R/I6zwxiboA=; b=qFA6n IMR4e3wY6Xb4WFd3dXBxByunPSr/s08qATCi2bMhsYXt6bh9anbwy10sjBYlcfNV eOMpF95Mv1sFR5ziNZsq+6adQPjqAZzapU3md2q6DfDVnz71/awdh2RD2PiGeHdu Enf2F5GPD4dCHysRvP7EhMeUgJqAoKtu9WLsj0= Received: (qmail 74521 invoked by alias); 4 Jul 2017 19:54:22 -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 73805 invoked by uid 89); 4 Jul 2017 19:54:16 -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=Unlock X-HELO: mail-qk0-f182.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=kVuRia8YFXoEvWTz1XsIZ+ncjsiGV69O6x/xBemu83s=; b=Ud6ABzMarbMX5mIqi8//aquvcRQi07vDG8xFxMVJqu9kQVvkwHbzUJi/m/nrnXsF0e YUEvewEYHQmPgF0iZ06Xgh7RmNEh5AT+sT/NC61hBmUTsRih9MyCtyrMWo44UGfDVHyk NMO81cEpktCHZbC58BmflwwdFSl7lW8M9dzxwC6FwN/b6jOSVoqPit2ZwZRNtB4k42+o nCqEoOV8rAfrVq0V9XRSnOF9thrYFOzmUiZc2r60KQaRJAP6aawkBdSn4BzcKcv18zMd 8YCPBbr+iWjI/MUkSABga40vCSyCED+fBbIdjXz2Mko5WjoujGnZidEh/osUaELSNJI6 u+vA== X-Gm-Message-State: AKS2vOzmwleha4Z+MlSG2Sds8M4z6UJUwqZFzih3Pc9CFNBsG8kuTD3F JEaTedcc/tg/BdNvVRqPnA== X-Received: by 10.55.20.147 with SMTP id 19mr53589972qku.204.1499198052078; Tue, 04 Jul 2017 12:54:12 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 07/14] Consolidate non cancellable fcntl call Date: Tue, 4 Jul 2017 16:53:47 -0300 Message-Id: <1499198034-5837-8-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1499198034-5837-1-git-send-email-adhemerval.zanella@linaro.org> References: <1499198034-5837-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/login/utmp_file.c b/login/utmp_file.c index 4dd38dd..7462a13 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 9959c87..fa7b4d3 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 7fd42c2..625bbaa 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) return 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)