From patchwork Mon Jul 13 17:10:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 40072 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 A3507388CC3F; Mon, 13 Jul 2020 17:10:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3507388CC3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594660241; bh=YN9OsBXN30C6BqCBIV2lEMhqF88wujZwCsdF77NXYu4=; 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=vDDK/NbfzEUE3O/6vgAjfmc6Mf0H09a6yRvJiIti1UXj9JZejbs76jJs0TmHBKCoV Ln4lPU97ejFWd+vSKRcyzVolLHkT/EVKR96bHeO+Sr10cHlygM00dT7NwMUPKNgh0F AAqoprg7YFHc1M0roZr+WfE3u08JgxJPqOvZSGWs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by sourceware.org (Postfix) with ESMTPS id 3009A388CC07 for ; Mon, 13 Jul 2020 17:10:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3009A388CC07 Received: by mail-qt1-x842.google.com with SMTP id 6so10531244qtt.0 for ; Mon, 13 Jul 2020 10:10:40 -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=YN9OsBXN30C6BqCBIV2lEMhqF88wujZwCsdF77NXYu4=; b=UUmVrXI39zikJWzIDHDYFkbJIahSILc6Y3cH72m7yZV8JNk7jcJR/zY3k321VFv6D1 +HMJNOTS8c6rubeDJlYkARZEyzojVNJsT7bds8mYCkDqKJb9NbyiwOpHDVrr+xQmUdjK Li3KFVhOkWxodb5XrE71mA2Pxu1nrovTvcNpZuljStcAig62f052E6VwlOiXTuG2GxEr wZz+6qrJ2sn/U5kQ3TRsMm2240nCW9+JTC+2euTW5xHaKAhhLGPmqJKFEmpucMnOwaEs IM8QGaY7/t7ZSwSglhDtJv/l9mKGo9HtFIQkFOI/G03ExCtJVakfu5rJaeMsBmXI8rr8 03Sg== X-Gm-Message-State: AOAM531sKYv9ZXtxCenaSZUV7SO9/c82RDSf1I8ehWGpPuv18Ua53aVH sL+k/BZuTYKsjUFSPwIHHBlpnjVNKgQ= X-Google-Smtp-Source: ABdhPJyfLR/jfe5QTmLjwvdTijtoHmpFo3yqTUXwTRJQITzJgcIfef6awgfKlE2ug74wu2mo0QTlNQ== X-Received: by 2002:ac8:2928:: with SMTP id y37mr297613qty.245.1594660239606; Mon, 13 Jul 2020 10:10:39 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id v10sm19767919qtk.14.2020.07.13.10.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 10:10:38 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 07/23] linux: Simplify ppoll Date: Mon, 13 Jul 2020 14:10:09 -0300 Message-Id: <20200713171025.3661832-7-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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" With arch-syscall.h it can now assumes the existance of either __NR_ppoll or __NR_ppoll_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski --- sysdeps/unix/sysv/linux/ppoll.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sysdeps/unix/sysv/linux/ppoll.c b/sysdeps/unix/sysv/linux/ppoll.c index 0f15636cce..079d56b5eb 100644 --- a/sysdeps/unix/sysv/linux/ppoll.c +++ b/sysdeps/unix/sysv/linux/ppoll.c @@ -37,19 +37,16 @@ __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout, timeout = &tval; } -#ifdef __ASSUME_TIME64_SYSCALLS -# ifndef __NR_ppoll_time64 -# define __NR_ppoll_time64 __NR_ppoll -# endif - return SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, - __NSIG_BYTES); -#else -# ifdef __NR_ppoll_time64 +#ifndef __NR_ppoll_time64 +# define __NR_ppoll_time64 __NR_ppoll +#endif int ret = SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, - __NSIG_BYTES); + __NSIG_BYTES); + +#ifdef __ASSUME_TIME64_SYSCALLS if (ret >= 0 || errno != ENOSYS) return ret; -# endif + struct timespec ts32; if (timeout) { @@ -62,9 +59,11 @@ __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout, ts32 = valid_timespec64_to_timespec (*timeout); } - return SYSCALL_CANCEL (ppoll, fds, nfds, timeout ? &ts32 : NULL, sigmask, - __NSIG_BYTES); + ret = SYSCALL_CANCEL (ppoll, fds, nfds, timeout ? &ts32 : NULL, sigmask, + __NSIG_BYTES); #endif + + return ret; } #if __TIMESIZE != 64