From patchwork Tue Sep 8 14:57:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 40369 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 51F7239518BE; Tue, 8 Sep 2020 14:57:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51F7239518BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1599577068; bh=Z9+yILVLjNRuvVqNB5E3jo1V1OOc1M6pX9M03oeEQxE=; 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=AT3og8lTN3LD0rnO0IkK5S+hDW/oxb1gg/4063uAVurGtjg0Gqq3HAN67sxKQ/fvz lcHjIR8yBlbJEkSb5ejEcQPZubN7/90DHi79xTnjiez5ckYXJRDjv7Pbavg62CD3K7 f3ucSnGj3K7EoeDxP5HCXGPCnL9Sh6kpoOGJNMwM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id D016E3861830 for ; Tue, 8 Sep 2020 14:57:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D016E3861830 Received: by mail-qt1-x843.google.com with SMTP id n10so12120247qtv.3 for ; Tue, 08 Sep 2020 07:57:44 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z9+yILVLjNRuvVqNB5E3jo1V1OOc1M6pX9M03oeEQxE=; b=AZ1OJVL5MYST6uUVERoikwnf0s8rgCJnXno9gabEWgthb64Vfv/yUuhRWnwqHS+/z8 7yfa/xhovctsQKXHS+hGf0QStzqVtWGCKcnRj1vU/mvKM3hI6MlvU6rtZ//SQpKNh/A6 pJe9nqXFW5KPfc7gG9rbb4A4EuK6KfG8nJN/tSmp6ZveCwCmqkqpzyRkpdh/kerpJ8GZ 6/6c8fzCpJXkUJbj9ThSyidGOu3tHMlu29Cu3KsSS6uXrezPARdZPMbiZKxtJ1VMeHrX Et83GFfZ9Y/TbLoe9L/HcgPqCpqZqGVX0JyWeZzwiDoWEkHroymJUfKO7dUR7Rsa6jiH RRAA== X-Gm-Message-State: AOAM533Vy7n8TXlYa+l00cOSpqPWh1o2gzZSFcuOhPDHf7CMrl3Tp36R A3VgkN8ggf9V6ZOdEf5MXoNBaeeJBzNzZg== X-Google-Smtp-Source: ABdhPJyJL8IqoCCj0KPcrIjPlSu3Lu17Ni2JGU8FhcPSYaUeUsozZ5TqOTUeHKpqOoyItAlP3uMs5A== X-Received: by 2002:aed:2907:: with SMTP id s7mr384295qtd.321.1599577064087; Tue, 08 Sep 2020 07:57:44 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id e188sm10800748qkd.55.2020.09.08.07.57.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 07:57:43 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 02/14] linux: Add ppoll time64 optimization Date: Tue, 8 Sep 2020 11:57:26 -0300 Message-Id: <20200908145738.640039-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200908145738.640039-1-adhemerval.zanella@linaro.org> References: <20200908145738.640039-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 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 continuing issue the __NR_ppoll_time64 syscall once the kernel advertise it does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis --- sysdeps/unix/sysv/linux/ppoll.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysv/linux/ppoll.c b/sysdeps/unix/sysv/linux/ppoll.c index dd2167fc55..e68a153427 100644 --- a/sysdeps/unix/sysv/linux/ppoll.c +++ b/sysdeps/unix/sysv/linux/ppoll.c @@ -22,6 +22,7 @@ #include #include #include +#include int @@ -37,16 +38,23 @@ __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout, timeout = &tval; } + int ret; + + if (supports_time64 ()) + { #ifndef __NR_ppoll_time64 # define __NR_ppoll_time64 __NR_ppoll #endif - int ret = SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, - __NSIG_BYTES); + ret = SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, + __NSIG_BYTES); -#ifndef __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) {