From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by sourceware.org (Postfix) with ESMTPS id 80B913983076 for ; Thu, 10 Sep 2020 19:32:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 80B913983076 Received: by mail-il1-x143.google.com with SMTP id u20so6851773ilk.6 for ; Thu, 10 Sep 2020 12:32:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R0Sm3lhJvVGJ47adSzGIfOLdgmhWp2ixo0Vi4MB7LqA=; b=hdTnAV2CmioR4pkXUb+J3UMwMvcz5jz+OWq2eoWUXjCtSdAVJlvIdGvLPPY0Sjp39o csyoYYVKFzw1LcOjfOxL2AHgu/u5h9Fo2eDsiKfAz8+eY/68+/RfN1iG37aG04ziDsUX xweglG2q+P2FNy6S6361BSNTY2dAq5XlgeEIierUnPjrQpGQhQC5DV0dlsMgvlJ6Piiv NxpJPF8v3wQBHF3P9O7ZIO5yY1s/kWHgj3WwFubDSn/CbTYjy4ZG4P1lupN6Hju+70bG rr69L4cbXLGLU2RSzLuexMV6RBINMRBMGjhtwjYImvKTvTStVUFlWmrDaIrCUSOxnFBI M3Ew== X-Gm-Message-State: AOAM532DJLC2tzCjoH7KSphxTRowXiHIw5gCbmvnBsrKDvIfT2W0SxGF 4SC3+w5O6uQtKZkbEyWVQ5pRDmGUfSKCk6v9Mu75wV/Z3N8= X-Google-Smtp-Source: ABdhPJzgLRt43oLuGCySNRPWB5DcAabmL2FLn8drERYQLv3Rb6djyE41JDbPNKei3+AQwwfu8+vURt/HChc/bauu+v8= X-Received: by 2002:a92:8b52:: with SMTP id i79mr9662041ild.177.1599766323056; Thu, 10 Sep 2020 12:32:03 -0700 (PDT) MIME-Version: 1.0 References: <20200908145738.640039-1-adhemerval.zanella@linaro.org> <20200908145738.640039-2-adhemerval.zanella@linaro.org> In-Reply-To: <20200908145738.640039-2-adhemerval.zanella@linaro.org> From: Alistair Francis Date: Thu, 10 Sep 2020 12:21:01 -0700 Message-ID: Subject: Re: [PATCH v2 02/14] linux: Add ppoll time64 optimization To: Adhemerval Zanella Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, 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-List-Received-Date: Thu, 10 Sep 2020 19:32:04 -0000 On Tue, Sep 8, 2020 at 7:58 AM Adhemerval Zanella via Libc-alpha wrote: > > 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 Alistair > --- > 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) > { > -- > 2.25.1 >