From patchwork Mon Jul 13 17:10:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 40076 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 BFE0F3890412; Mon, 13 Jul 2020 17:10:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFE0F3890412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594660248; bh=QW6mQv3m0dD2g8wDj4jonFzJPEcwS7NmrZLjWDZLzCg=; 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=uWpHj6O6jUnG+C1NL6TNXwWpdTz+6UNpibSBKtj3jBqJUA1yOkpX8DNPm7gy7Af35 dGW3nCj+9q45Cy2m5xmjZrDNgWcxk2JO/nl3wRtMLQwP2AqhDtc6mvyz8leZUW1bDZ j2tID6+jEt2JOeHSgxGM3mMcV6Gwks5M23Om63+k= 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 65439388E813 for ; Mon, 13 Jul 2020 17:10:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 65439388E813 Received: by mail-qt1-x843.google.com with SMTP id x62so10539091qtd.3 for ; Mon, 13 Jul 2020 10:10:46 -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=QW6mQv3m0dD2g8wDj4jonFzJPEcwS7NmrZLjWDZLzCg=; b=s/2Th+2MEaS6OwsBYznQMvjoOYsiqNiz1gMdCrQjYWGdJ4cmFO8/UyYuPIhQU4Akgv LX5GPRV/fW3FvBKDcTJWgrn2BJxOyTrGl9QRYApkUgcmg/zTEaltMZ6YSvylz5MR0Tpj 0T1uUR4qQHYmARDd4rRv8bawDgw9I7qtupRUwpqAj71GSEVszN46bLjotuGK2rwQr1WY PVb3YsYgmsvJUOOcVKslwPkyiyALN5iWdaEP1gfYimzpLqMZThHj+Rg6CiTI3l37HLls cc2ixwzA7HdpCm/c7wk/4hlfnyXyqsiKu6SWJmprcINWEPLMZ7v/cPQgAje7p7okgSfv KdyA== X-Gm-Message-State: AOAM533rrp6gcfbRhtSjJTtCVoidiJx/6ouDSmruIs6h+VT+XpyrfIxT GxxtexZXzlPGMtBjVPFA++H5NCVSA5I= X-Google-Smtp-Source: ABdhPJxji8YExQd4v/1up2f0Jm08C4vET/BRk/Ctc7dxYsppmuISPWNj3RGrGxRf62rN796afLqBoQ== X-Received: by 2002:ac8:4707:: with SMTP id f7mr377666qtp.22.1594660245694; Mon, 13 Jul 2020 10:10:45 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id v10sm19767919qtk.14.2020.07.13.10.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 10:10:45 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 11/23] linux: Simplify utimensat Date: Mon, 13 Jul 2020 14:10:13 -0300 Message-Id: <20200713171025.3661832-11-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" With arch-syscall.h it can now assumes the existance of either __NR_utimensat or __NR_utimensat_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/utimensat.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sysdeps/unix/sysv/linux/utimensat.c b/sysdeps/unix/sysv/linux/utimensat.c index eb16f0f3d5..ea23c2f051 100644 --- a/sysdeps/unix/sysv/linux/utimensat.c +++ b/sysdeps/unix/sysv/linux/utimensat.c @@ -28,18 +28,15 @@ int __utimensat64_helper (int fd, const char *file, const struct __timespec64 tsp64[2], int flags) { -#ifdef __ASSUME_TIME64_SYSCALLS -# ifndef __NR_utimensat_time64 -# define __NR_utimensat_time64 __NR_utimensat -# endif - return INLINE_SYSCALL (utimensat_time64, 4, fd, file, &tsp64[0], flags); -#else -# ifdef __NR_utimensat_time64 - int ret = INLINE_SYSCALL (utimensat_time64, 4, fd, file, &tsp64[0], flags); +#ifndef __NR_utimensat_time64 +# define __NR_utimensat_time64 __NR_utimensat +#endif + int ret = INLINE_SYSCALL_CALL (utimensat_time64, fd, file, &tsp64[0], flags); +#ifndef __ASSUME_TIME64_SYSCALLS if (ret == 0 || errno != ENOSYS) return ret; -# endif - if (tsp64 + + if (tsp64 != NULL && (! in_time_t_range (tsp64[0].tv_sec) || ! in_time_t_range (tsp64[1].tv_sec))) { @@ -54,10 +51,10 @@ __utimensat64_helper (int fd, const char *file, tsp32[1] = valid_timespec64_to_timespec (tsp64[1]); } - return INLINE_SYSCALL (utimensat, 4, fd, file, tsp64 ? &tsp32[0] : NULL, - flags); + ret = INLINE_SYSCALL_CALL (utimensat, fd, file, tsp64 ? &tsp32[0] : NULL, + flags); #endif - + return ret; } libc_hidden_def (__utimensat64_helper)