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 Netto X-Patchwork-Id: 1881158 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=seOGDPcV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T1wm707qDz20RF for ; Sat, 30 Dec 2023 06:43:35 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E46173858408 for ; Fri, 29 Dec 2023 19:43:32 +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-Google-Smtp-Source: AGHT+IHV1n2+Krww4s4PGkrrY77Lx8nzn2sbBsdt0zhHTFOxo+B/a8A5TrQdKYM+ZwZpaZ8YXqF0Xg== 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+incoming=patchwork.ozlabs.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);