From patchwork Fri Dec 29 19:43:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 758787 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp4640125wrw; Fri, 29 Dec 2023 11:43:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcvWlK2mJbQTWSiIrhngYCtUx0HtwbP+ArBnb++SKrzxK8NZXMSJGqtgykNxFbPayiElIn X-Received: by 2002:a05:620a:261c:b0:781:5207:6f4c with SMTP id z28-20020a05620a261c00b0078152076f4cmr9389637qko.68.1703879007723; Fri, 29 Dec 2023 11:43:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703879007; cv=pass; d=google.com; s=arc-20160816; b=NXQosClJFQt6Z404efi2CQXmvMoR3hh78qf5d69yYk7P/7GgaC1qIzCvebqLl3q3vu Ho0l8X8yNDyp9wvBEHceqSUZgy8X1+KTK9F4JZ1XYlX0cvLib640eDQf6a3mRqL5ichl Q3cJLDeA398NSogLG14bxLc86mMilggYJyXqWBofmw1iwlDG7f7uHV9RGS1SDvT/H5Si zcZ3Qjl8qQz9+LXYJQ+5ZxxxUKIvJiKev2n0SEn9ZB8bPOOU2yi3x9lio55bJBdBljPJ Y9BULXa2DS3V9ifQ8hnBGvfvUwgKLmD/AM9Wb0EsWGPgZOBm5nbHxJO5PB7Iso/S/zk8 z/ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=1xdiAGuWnt9XboIWgbf7zpNJeeYStNFc28vv7zGEGAs=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=BXCmOHTP+CHkmI82u+r22XLefPRNBDs6n32MV9xy4dbR3OqxvoK/rdRPSQsH4l7bWf qLNcbbGzXrdl4AZm9LtQWK1TfKQMPp0tFK2VO7azKoEvKYSZpZZEUZeC+oiyoMf/JIJ3 NuOGJsyEEy3GMi2Y7utxZlWb45L6e4rBQw9UebZXD47g61hmymwWM5EPmcpqc16cOJwn OyyY8muvMHIwOUVQnZ3KGPvsI7jS5ZJBMvR/aUkvVdrTimKER26VQq2Zxv/ExkshILLD UVe5PX2Boqt60sU9IgqnwYj4rDF7IVh5OSbTowJz9mhvjMjijtM33eDtTFa93hjw7CW4 hsBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=seOGDPcV; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q17-20020a05620a025100b007815ff76435si6024876qkn.455.2023.12.29.11.43.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 11:43:27 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=seOGDPcV; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B2293858404 for ; Fri, 29 Dec 2023 19:43:27 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id 1D1BD3858D39 for ; Fri, 29 Dec 2023 19:43:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D1BD3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1D1BD3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1036 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703878999; cv=none; b=bC446porLq3nF1B+mu/c+i8oon2N5vLbsfVgJEXbPBt7O1+iZb7rYlq39yngBvDJtprwrH+OaLWJSWzLTvSeFECXsVIYkUSlf5NuYxf++x/8bvuxntSUBhjdbMHDqqkDk8bxluWjfyoeCFu5SMKXdujNMlW4QTNjZfW2Icfmocc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703878999; c=relaxed/simple; bh=MQZbCeQL26L5wIxekwqXYidYkLTVASlmGNuyLN/e1sM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=oCWjBwtqaNuoTfOKtUasbzzpv3LxZGFROuZotIWzjckmFsKhcQM4gyd+wiZamyhKyDB5KiSJalJtD0e82CiomYH0HZCWlbD9mxgP73V7iZeeNALhNtStgLF64MJWQeakGxYc9F22b2mD/E43VVuR23roxPmaYYBuCpFdwJGFVWg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-28bfdf3cd12so3177960a91.3 for ; Fri, 29 Dec 2023 11:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703878995; x=1704483795; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=1xdiAGuWnt9XboIWgbf7zpNJeeYStNFc28vv7zGEGAs=; b=seOGDPcVYkk3KErzvp+wNHvaGHepcG0q6JzqfMBDvtL9J+8bUNuLuEmz/G8uGqSDLm pvebP/G9oN3ULA29Ie8Vwdy9i+rtlPkXYldodHpLLGHhdnhOdIRjRIhH7A6im2rFgge3 S9D9V/tA4mjYFy55B6k30uaREPMKbIATDyowgGqghLvoWgNU6fkjEVmV0bhh0RYxPP+d Kojpbl0Y5lIXXB0sE+h4ilp/3U7dZBOZbcT8kBwg2wVq0gYjJpasD0hIDRbrtoLppj23 tPT2i/3F93LELQSHgMO6fsGE5LJWIJ534t/kWUhOyFYIUi9IiUWAoUnrT5J78Lp+OYys HvQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703878995; x=1704483795; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1xdiAGuWnt9XboIWgbf7zpNJeeYStNFc28vv7zGEGAs=; b=Bn6R3ZYTFXjqfKVxHB6a8c182wrVa9JVP4km/Th3vGuggtbOMTl5CENA562hrIgIQ3 FmUZQsl0UgybgvKJPWdUiB0DYQ1QK0UrocQ+zA5CugmnSEeIprEZGTBNYqsLQ2epDyhT koQZ6WOGGHp7m+qh7Ra5DamUM/QtAEgjfpUek5MBOBgeb9ysIIuEhS8YVoXSaqzGtZ5s okcdEF+8LxS3UFB6xYtKLaBbvzTTEsRqYLBhSsIfl4SKDBna/tf+Z+gHwsXs+rK5BXnl KJfsxClguecwCEb9XtQorBd2EzVfF/KafLpzbd4dFYm5RblpCgOx8x1Y1r/7vfFj0iKK ehtw== X-Gm-Message-State: AOJu0YyNppDcrkhUgXPkZX4HJt8KVojrXT4JdY8VkcAbe5HxAJKpq0Fc YRw4qtS6Rwp+dsuNrBsWtEqQtiBAxTHqTdQmh4+Eg5SkUnY= X-Received: by 2002:a17:902:650f:b0:1d3:ed56:88ed with SMTP id b15-20020a170902650f00b001d3ed5688edmr4373883plk.113.1703878995276; Fri, 29 Dec 2023 11:43:15 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:bd9:dde3:9b0d:113f:5b12]) by smtp.gmail.com with ESMTPSA id m24-20020a170902bb9800b001d4898862cesm4106213pls.211.2023.12.29.11.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 11:43:14 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] linux: Fix fstat64 on alpha and sparc64 Date: Fri, 29 Dec 2023 16:43:10 -0300 Message-Id: <20231229194310.3213583-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org The 551101e8240b7514fc646d1722f8b79c90362b8f change is incorrect for alpha and sparc, since __NR_stat is defined by both kABI. Use __NR_newfstat ti check whether fallback to __NR_fstat64 (similar to what fstatat64). Checked on sparc64-linux-gnu and x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/fstat64.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/fstat64.c b/sysdeps/unix/sysv/linux/fstat64.c index a291f0825b..d2272bf49b 100644 --- a/sysdeps/unix/sysv/linux/fstat64.c +++ b/sysdeps/unix/sysv/linux/fstat64.c @@ -30,7 +30,10 @@ __fstat64_time64 (int fd, struct __stat64_t64 *buf) { #if !FSTATAT_USE_STATX # if XSTAT_IS_XSTAT64 -# ifdef __NR_fstat + /* The __NR_stat is defined for all ABIs that also define XSTAT_IS_STAT64, + so to correctly identify alpha and sparc check __NR_newfstat (similar + to what fstatat64 does). */ +# ifdef __NR_newfstat /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and x86_64. */ return INLINE_SYSCALL_CALL (fstat, fd, buf);