From patchwork Tue Jan 2 14:31:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 759365 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6070684wrw; Tue, 2 Jan 2024 06:32:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrKX96/TEDRaQbkmA3X6fHzf1zqn6LBo76mgNyFOO7ivwyNJBn7u5H/WFYu1a/ydVhYm20 X-Received: by 2002:a05:6870:1787:b0:204:1cf4:e7dc with SMTP id r7-20020a056870178700b002041cf4e7dcmr18478690oae.119.1704205931580; Tue, 02 Jan 2024 06:32:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704205931; cv=pass; d=google.com; s=arc-20160816; b=jD37hZppZvBj5PGsV8G7hhGuc7T3Bi4SPl5S+XcMTLAe0xM5JqsBpxIWe1s0yZmV6J K5qVOn2IAp9bLTTf/hwz1Y2/z1xakSdPBK34eNuZy+wskUAZ+eDHknb8Bt5Mp8VfOxOk 6ABahvOU48qlAtyflev+0uN7adV6yds6u5t3tir03OPgDKONTaHgIytJO3mu6fZ+3Dt1 CzyLrxbpo0jltz30Ygh90t472RGrIQeFclHKBRNGi4HqAeaie23pYzI8OUcSlFGH31zS HZ2iShaRq/2CXkhFlQd9fp1DMioPc+nRddGBcXsWWvIIfP+d99TeLptI7Qjp42Rp9BGy I3ew== 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=NZOfTvwIFDWcUtxsqZ00Z7sAYwyJD5u6ZwtTPDsOnQE=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=uWi6M4vtK0HZLgocQIh1VmUYrMsqUbiqffV7OP/sN0XXCByvRrfS8c1+LnjSefDxx9 HyKXaWUYim4A117ma2fpuLcfUJUsIZN9E34wuwI+ri7OcRXSKA2WJqYOKnfHh3yY+4SJ H7tXBv5O7U+5ThANK1GRSU47TViU5r8FiyXwnbpr9rYOCIIylFvCKGj1cTi5jJZcTyo3 nIHl1ssCAp80/UwrIYtGpv8yZ5bLj06GLfSC1w6NUpGlLjztNYMTvaXJJMA/FMzr0F4T ctXoqjZlpGkwc10DSOCK2vsMdpolUGpvseyCjE/H5ouDZDxLf4crCzm1Vr/YZCvw74di bKFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YfsAaMda; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g8-20020ac85808000000b00427fb21bd7fsi11636341qtg.519.2024.01.02.06.32.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 06:32:11 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YfsAaMda; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 2AC7B3858417 for ; Tue, 2 Jan 2024 14:32:11 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 3BDDD3858429 for ; Tue, 2 Jan 2024 14:31:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BDDD3858429 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 3BDDD3858429 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::436 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704205921; cv=none; b=wTGBj1yDNseyro1T1aCJzjnRfvJI80QbAmDNBuhLgbmPKhhCY2OXurGalwCxTHs3XWU3xC05s5wX+oGnUV+1Ydn+IL90MHpBmrrZnIULosAapv+b3f2io2yk462yr8o26khgxQhj3ogXLL1SfrR7LAo3Alv1WUkOI29ojm6H3b8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704205921; c=relaxed/simple; bh=dEnfm8u/WsQFRid154NR+uxW9ATrXbsQIH6NCUkPvQ4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ws38M8oeym61FythQAlaQEXCMDTEivakC80sbykETrM+P+Q8Ch/YVTenQrJ8YsHnGv6+8a3y2jilDvfhFayu238pUJEyR0EnQR6FRVWObrA55rMcDpLGLGsMV/4Po7twSONEiXkjex18ZsQP4tJFg5eSXP1A35A/Tpwecfi5e2c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6d9bc8939d0so2016149b3a.0 for ; Tue, 02 Jan 2024 06:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704205916; x=1704810716; 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=NZOfTvwIFDWcUtxsqZ00Z7sAYwyJD5u6ZwtTPDsOnQE=; b=YfsAaMdaLNQXXT4uSbm3wKq0+zrh2OeEBE6bGPaXyjFYjtqLbXvqr+cY6xYpQYEbio 2aNq/8wCWmXkLAL6/ya+MQG2E0E4ev5PsX0w/7EBma5ErqJY4BkhQNE9zUQNXuv67OPY 50MFsfnwCHQTWu0AYQPIMh6va3Ob8dnBrQQmeN1U3FmVP8jrHb94lCes23yegzopkX1l 5ZhTCVYBh2sD9tXZaIbEn9k5ClRZYwsOrfxJ1/lTGqnYNJQf1Krj+O+3xkJZtr7PNk8q L5dhoOZ26RLNbXrMLxqLD3Wo/Zr4d8hC8LR35n9VGSVtmpbYESw1yCmffucg/AaWG+Ft QHXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704205916; x=1704810716; 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=NZOfTvwIFDWcUtxsqZ00Z7sAYwyJD5u6ZwtTPDsOnQE=; b=BfK5B4HmQipBRAt6cgg6loAjCexWn6008ITprte1VlE4VVaDetedKKkO/HfZ9UDw0Y 1vdDI8gX0Ze21kaVx4mKVoRPXmO8Ea3OVuin+9RiXtRJoJpl8vfwFlwCz7wSxVg843ju d0PIEvP7qY+xnaAYY5LxCneqnrBcWWIYeGx7g9k9ZbYORcyEoi0IVfRUkxSva5/+dUHS ypV1LlJYQoJqLudRZkhqRFOC1yKaKf08QS4aAMiHS5jbfONfdKge+ocgLN4Ll0vzpcrC JM/1CZRtl/WEHBsqyyJwJ5zl1pitx96eNAtIRWocCjJyVm3hFul8KJoJ8J8/yNG1mJch UNvg== X-Gm-Message-State: AOJu0Yz+0tc6D7xsgdvCcN5adqj7n4tB5ci+2OQWoHXsHyXXf0ffJoV5 wplGioOd4YZvXRft66ASenG0k/b1RDI12vaOJSUUTn+0LOg= X-Received: by 2002:a05:6a00:6c8c:b0:6d9:b3ce:9bce with SMTP id jc12-20020a056a006c8c00b006d9b3ce9bcemr7566593pfb.40.1704205916523; Tue, 02 Jan 2024 06:31:56 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:bd9:baeb:2909:d39f:d373]) by smtp.gmail.com with ESMTPSA id b10-20020a056a0002ca00b006d99ef226c0sm17495208pft.136.2024.01.02.06.31.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 06:31:56 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2] linux: Fix fstat64 on alpha and sparc64 Date: Tue, 2 Jan 2024 11:31:52 -0300 Message-Id: <20240102143152.3477636-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 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 to check whether to fallback to __NR_fstat64 (similar to what fstatat64 does). Checked on sparc64-linux-gnu. Reviewed-by: Carlos O'Donell --- 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 b4b5dc2908..cc9f695df9 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 macro 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);