From patchwork Fri Dec 29 19:44:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 758788 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp4640506wrw; Fri, 29 Dec 2023 11:45:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHz+L16vYBWK6g65RqTQNBJscNSWDQEzx2VodSTzPZVO4xCH9vlclERN9qxhWgM3Z5gQKuy X-Received: by 2002:a25:8e11:0:b0:dbd:5780:ff77 with SMTP id p17-20020a258e11000000b00dbd5780ff77mr6236061ybl.12.1703879102664; Fri, 29 Dec 2023 11:45:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703879102; cv=pass; d=google.com; s=arc-20160816; b=JjyLgOUGM1LSMjO/oXkUf+WYdqxjLrR0NaliQiZXGsdEHdF3wskqXFPH/bS5CkzIFn 3h/FpXe7AZVBd6FxygekQY4/2VOBCw6SijXCSwaTw1kZ4ePtchVm8dLBuMXwE3IQui5c BQ5MdSCiUBv4EHMa+F+F7V69mFeHVx+BVt8CP4zEIEvH7iffP17Df6Y7gJ4ZhJCNAHPb 4Iwgoa35jZciv1t6+qR8PMvvkKDkdVC4kgcL/flgss5lniRm4RFz1FU5niCTffbyTEo0 PVKAd6WaQ0vk/ZAcF13hqD56rO1oR2f7YX1utL3VaJXZGl2NiRfvbB2rZswTNkDe0WMh CGRA== 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=VO1a7JtNddwOmtBz7HpDUwRaSosL2+yfWhgRyCrSm44=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=wvFcT6v56fMk2xwWOrANIDmAqVWOhuIuru2B+wgfIRe6gu3+jKAKlP7PcexoDd+Yao 2N/xdB7/uyhMZ4sM4ncMgrhWM04n5iv3GIUw6dMIhpsJT5SjDMZQyLTvGb13DSYHvlY5 EYvphDLRzp2+wjytIWwsPPIxflnYiIjbQslkJPImWX8jUHBDFHag85xX4kpdGE1GXoXw 6FE33upUQ2caNEHJpFRX9Wa9dC1Sh75pTDzTskKHlW8of8amfcLyVQqHOj0hWJT6wpas THmn0v7aXeUc/REuvMS05scZQjMNxEvH32y/mGDWY/HW1i83ULoB+QuNV4+cUpZXBNi4 CwnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zteuyKwL; 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 ex25-20020a05622a519900b00427fac23b0esi4171991qtb.485.2023.12.29.11.45.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 11:45:02 -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=zteuyKwL; 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 385363858C41 for ; Fri, 29 Dec 2023 19:45:02 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 496213858C31 for ; Fri, 29 Dec 2023 19:44:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 496213858C31 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 496213858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703879093; cv=none; b=hFCsdl+ILBl1FrJb8dd18c1MzSRY51uRudAy47gMy0Z6MuxQE5Evkxn3ozQTAyhhgpz49AHCeidFLtS+u/MtSecV2E8VA5ubIY+tOQjTVguhiRXrcBsJlBbDPhvIupvFbqJBrJzszyDNGl3WfHbZzSoY9h2IZC6KdM4d4BEVbEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703879093; c=relaxed/simple; bh=1dtRTcLNjvNuRrAnQ4zJepm6o+hpOJI4beXsvp/xOrs=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=eJv+DqbFWqsf/k1Owvd03633LLVBqmKh+PJh/O6uqWjfDxZZKV0hURdQf3/mz4XA1GSev16+fdY3tKS0AWsjrZPNrxYAqGTUXNNDqZ0FPK8er3v7YZYnXrGEyfClUltHqdQArzE+Xkesb+/UQLIZKoKmQj4zrc4nYuz/2Td4S98= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6dbca115636so4275590a34.2 for ; Fri, 29 Dec 2023 11:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703879088; x=1704483888; 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=VO1a7JtNddwOmtBz7HpDUwRaSosL2+yfWhgRyCrSm44=; b=zteuyKwLOMwxUa1E/Wc2DHBrOjRgaWtHbZa5n8MgqcTuQlYY6/kUUOTtlxReH9N7Sg MD7fKcBdUCbeTQMPlaGwToS+unpDQQoyCFQCs7047QdALJspFB2QxN+kAHhkZ4IJMIeD duCQjnOrpnxGcKx/MVXfHHwlfVQw7tp17Q8W3Fh5mmz9AvSXj0P4HiWZ21zAmaNbiCHP vTJ+llhfNn9e5O6EuS8iV5YkX5xDdmmFmFydXJIzzSr/E+sCl0MKXQlZVfBQagWPOJPN zOoXQKwW/0BX2q3K1itLT4fM4bgzmyQX0B2l8cga9E+rOupMs5rWxOEgty2xPsoNrXIA 6Ohw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703879088; x=1704483888; 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=VO1a7JtNddwOmtBz7HpDUwRaSosL2+yfWhgRyCrSm44=; b=J+GhPhrFh/j20yzG2e80eU9eL7TQlRL3QtVJXXQaTv0OFoRXO38/EpGT+Z8Q/I/Jv4 Y0STH8fgPPT63huoAvS7uHs88aA5ZE8tl8b2RhXGw/pwx5Alx/DIhxsHQWGSnWr+2tJv IDODasTh0KHl4kER4451rQVio2XbjBsjb6FYbKqYfXtBUfXa0tl8VxZGlCGs/tpeN6Iv uumHBZDO5sQPWelqDasQuOc4GH2MNGP8vzV2Q6g3NrNEkqsOuVaheS84/VFGoN6dc5l9 z/jK//y9swik7CwWaUFNlyTZPaYt3aB2w11QZ7n8n3kez0WvDPpxL7/GW3fjYCOk9fXm 9FMQ== X-Gm-Message-State: AOJu0YyrnnpxsoWFH7lPKqaE3mj858wtinEzerl0jGDaEPVzevjihS1/ CpHvjaED0G7rJWtyt+0G/A3klROvuiPoTm96QEo8zW1q8Ak= X-Received: by 2002:a9d:6e03:0:b0:6dc:8d7:bb2a with SMTP id e3-20020a9d6e03000000b006dc08d7bb2amr4093759otr.26.1703879087907; Fri, 29 Dec 2023 11:44:47 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:bd9:dde3:9b0d:113f:5b12]) by smtp.gmail.com with ESMTPSA id t16-20020a056a00139000b006da04ab75a8sm5153678pfg.1.2023.12.29.11.44.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 11:44:47 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2] linux: Fix fstat64 on alpha and sparc64 Date: Fri, 29 Dec 2023 16:44:43 -0300 Message-Id: <20231229194443.3213761-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..0f1391067b 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_newfstatat (similar + to what fstatat64 does). */ +# ifdef __NR_newfstatat /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and x86_64. */ return INLINE_SYSCALL_CALL (fstat, fd, buf);