From patchwork Mon Jul 13 17:10:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 40079 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DCA873892463; Mon, 13 Jul 2020 17:10:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCA873892463 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594660253; bh=6zOoBJXxtRpD6HJU6X3J8fnW/+fOLsNKVfpb+qobiO8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ksZZ4kfRzZ2/lF7bL0ReH4mgmtdGtD7xt5/RUCr0RpEhEALc8o25hOs5zeZw/HoFM Bn4PQwEl6kJ2wLLugOnldbN/qiJEeJHtjob8KkCG3/SpbbHzGBZiYfzB3aWIgU67QA yF0XFZ3JaSfDEUDKlsK/A1ETaU5KWMwxDKW7OzEk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by sourceware.org (Postfix) with ESMTPS id E020E389040B for ; Mon, 13 Jul 2020 17:10:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E020E389040B Received: by mail-qv1-xf41.google.com with SMTP id p7so6115541qvl.4 for ; Mon, 13 Jul 2020 10:10:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6zOoBJXxtRpD6HJU6X3J8fnW/+fOLsNKVfpb+qobiO8=; b=s+RAvx2WtjbARODfdXEYXVa6SMXc5Cou3YHhtIHnGZIXlwGZ++lAax3uONkMjhy6am KrAoduV1lhZeoyxz2tb6c9kgPZQjMWL8IJsJOfO8Q4OkYkFJPTgzlX2CX5aqDWBtwi1q 1HSw7d5z4MzA+kQDHsLzdy+j8JFCAKFCs6z6EiJCEjGlPSLNkSGohUk+uQ6a2gAFVgEl fP4kUofsiZK6tIhOBCWfOOFGtxCJCbtjR9Mk8nTNlyPMK/y2WepNFD6QB0sSlDHc0DFk sXzmDIUsufNUAEuQ7rzQvTJ3ZIY86PBZ+heGa27cfL+/iwwYs7uPvwb2FXTLhlHtznrD EscA== X-Gm-Message-State: AOAM533gpjbtPxAYFrTbbpUdLDm+ekWmMkFMg8bGyw5p9rXVdKjyyxln Fs0zH6fOtSnueXllcJFrjrT7WCej/SQ= X-Google-Smtp-Source: ABdhPJxG402mSuBYaTEXQt9jx2+opNwLhFk6ZlE0M7SwdlDvTGL2eIfkWRmS9BAPCVj/XQTBcgdtpQ== X-Received: by 2002:a05:6214:8d1:: with SMTP id da17mr474790qvb.62.1594660250229; Mon, 13 Jul 2020 10:10:50 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id v10sm19767919qtk.14.2020.07.13.10.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 10:10:49 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 14/23] linux: Add ppoll time64 optimization Date: Mon, 13 Jul 2020 14:10:16 -0300 Message-Id: <20200713171025.3661832-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713171025.3661832-1-adhemerval.zanella@linaro.org> References: <20200713171025.3661832-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It avoid issues the __NR_ppoll_time64 syscall if the kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). --- sysdeps/unix/sysv/linux/ppoll.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysv/linux/ppoll.c b/sysdeps/unix/sysv/linux/ppoll.c index 079d56b5eb..c4e5b0e733 100644 --- a/sysdeps/unix/sysv/linux/ppoll.c +++ b/sysdeps/unix/sysv/linux/ppoll.c @@ -22,7 +22,7 @@ #include #include #include - +#include int __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout, @@ -40,13 +40,20 @@ __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout, #ifndef __NR_ppoll_time64 # define __NR_ppoll_time64 __NR_ppoll #endif - int ret = SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, + int ret; + + if (supports_time64 ()) + { + ret = SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, __NSIG_BYTES); -#ifdef __ASSUME_TIME64_SYSCALLS - if (ret >= 0 || errno != ENOSYS) - return ret; + if (ret == 0 || errno != ENOSYS) + return ret; + + mark_time64_unsupported (); + } +#ifndef __ASSUME_TIME64_SYSCALLS struct timespec ts32; if (timeout) {