From patchwork Wed Aug 5 08:03:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Goergens X-Patchwork-Id: 140627 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54DBF4BAE7E0 for ; Wed, 5 Aug 2026 08:03:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54DBF4BAE7E0 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=pYZpxMmR X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id AA3BF4BAE7CC for ; Wed, 5 Aug 2026 08:03:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA3BF4BAE7CC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AA3BF4BAE7CC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785916990; cv=none; b=t6hOtUZBsOVXsvAjTd1wOVnsX1AaxyUqfs6cn2Q6o9sPujd/AtcfEHkegY3nwAGEaBXycrlM9s3HLiQKdnH0Q6gX9cyqpzvjABx5xGBGlS6II+4X+JQF5DpadbX7IZgW9JDztxfbYurIIS6BrH1Vq2BRRqdWt+go+3Crlc2WMGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785916990; c=relaxed/simple; bh=rHzSUiqFjjGBnhkIU+qMdFi/+w5JUl1DsA642EfELLg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UOBo1titIaGOuuyL8DxR5+I5SXPD+mBPc4H60pqFCnfmiaXGLUQa4IIu9WzNJ9s0Ug4P0Q8csziFVgmGbEvq1P6h/M0l0NN9BrY7k+1EZ2GqObF4fmBxbnUURo/GtYleMec2rwzz//E4wmsPNK4wxbjZBzMYrUc68m0im36QtXk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=pYZpxMmR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA3BF4BAE7CC Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-84847482584so658044b3a.0 for ; Wed, 05 Aug 2026 01:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785916990; x=1786521790; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=c5xvnQVBJvZonkBaSoiu7HipGRasYyw4YPDEqRlLhF0=; b=pYZpxMmRgfVsyEZq8MW8FiQBdsNtF2v6perZ8IFXn438iY+dtsyIpjL7JS9RYNzZME DairPdnb37omwvDYM0fK8BuAG7ADGIs2gpk2qsLEiInfpn8aTRV9Ivt3kT82OFrConBT +U+wr3R08sYeLVKifAo/cX8AjZrtAnFnhSB3smWwj7gktj8IZLchJlDLCLlVzRBeVOeQ dbUR8hYwn4u0GydyNeO5rFQ5vpajUiDM/ShFtMzDj0fBpPDnee3TZApelV9nKPyHHUMD JiX2BO4Y80X0OeY0Q/HbZ734XV6q0XPm0ws/S2YOYzxgoxz9JT3WrL2eXwxDVh8RAcq7 FlkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785916990; x=1786521790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=c5xvnQVBJvZonkBaSoiu7HipGRasYyw4YPDEqRlLhF0=; b=LEVkPZd0O7+QyNtNx+yok+5aLQstF68QDu1YzGmqEfzIRVT5FTTbGHx92RU5TqFTXf mIi2UW51e9WKCTGlQX24XW0Oohj7wDuuJeN1t89aTSxhPsa0QRTOFkhLnkQ+gofKFjP+ F1tnooP18AxMtmCyz7qofd3wVB110Nr4a0IjArcaqbHR3AFKScuLCupqi81JCy3/q5hT BJzmprfL7/5OW19MBilUmvFYQd3NXXH6luma8tIiU/37pz/VDa5bmmR5TqVshnG/sFNL sD4OWQzp+QCx+cYBjRpqFmJGJwO+gayNqXmyZUMfo8/T5KWXeFHOSfTek7hFhyMxyzOe 8k3w== X-Gm-Message-State: AOJu0YySnTAqpHQ1n7pAniHroxVDa8V/h3obCAVa1VRHn6qVcwAxQRrC /LJOr9d7TUUffbAT++/u/TGHeMdSYznr1KZsCYmvu88WAl7Ps8dl6d/ctsoFF3V4 X-Gm-Gg: AR+sD10AsRa6ELNDexdcgQXqOtddiZ6edRk7TQVquTYD3RGOlCkh0MBxFpdQW1D8kJC CiCUXIn09K7k0xnvf9v06RhOmW5EjZa5l72wBl/R4r8cXKe+oZ+1Qfsq0P7QWILrCIrV5jeDOxQ bUgpJRt2nmnr1uujXUO6XlcdqdrHGp/aeNZY5lJrFjkwhgrEGQrfm5GMqzP5yaqkqb92XwFLDLm Wg6BbU/Kor4SNbWaffFodRjWpvRiZkmtqZHlQ39fTWv/v6W4reIFiiaWWgGZ0x+K3igRcOHlG8s bx7rLald1YDjqMGx4ztLtjZoRV4n4EtxRvGSwsa9mQGFed96rQGKFwyhsOsx9qhbSI9NVcFHjSU wZ3zxPF29/75tMDmdcMqaOaPjQjJ+rji3dmnQFPQcUIXWMKs2hrIt+r+BEJo9stoT7N5u4o6sRx JTGHSOw3qbs6XpvK9NhFmTYmx+rDQYJ8ivZZbvfWi24l8gtAoAuklFkZb2nhZmTxvakBr/eWYbH +NKg0seRysc6gR9kkVsE81RLSwcPONJZU5BbjZ/Qek47eL1ShRKTmI2r51EhQLyEqBJSUYG+QW4 /sa9ZjDzQ423EX9zaAY4ewjdeqJxMhbkkZ67iccVlTkABwh7k5aa X-Received: by 2002:a05:6a00:4b07:b0:847:9dd7:2683 with SMTP id d2e1a72fcca58-84f1caa1951mr8573974b3a.9.1785916989502; Wed, 05 Aug 2026 01:03:09 -0700 (PDT) Received: from spider.bream-herring.ts.net ([103.252.203.158]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbe707cab37sm973517a12.7.2026.08.05.01.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 01:03:08 -0700 (PDT) From: Matthias Goergens To: libc-alpha@sourceware.org Cc: Matthias Goergens Subject: [PATCH 1/2] linux: Fix time64 stat nanosecond layout in strict modes Date: Wed, 5 Aug 2026 16:03:03 +0800 Message-ID: <20260805080304.3535401-2-matthias.goergens@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260805080304.3535401-1-matthias.goergens@gmail.com> References: <20260805080304.3535401-1-matthias.goergens@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@sourceware.org The time64 stat helper tests __BYTE_ORDER without its defining header. In strict pre-POSIX.1-2008 modes, both operands are undefined. They compare equal and select big-endian member order on little-endian targets. Include bits/endian.h. Add a test comparing timestamp member offsets in the default and POSIX.1-2001 feature modes. Related to BZ #32119. Signed-off-by: Matthias Goergens --- io/Makefile | 15 ++++++++ io/tst-stat-layout-time64-legacy.c | 35 ++++++++++++++++++ io/tst-stat-layout-time64.c | 36 +++++++++++++++++++ .../linux/bits/struct_stat_time64_helper.h | 2 ++ 4 files changed, 88 insertions(+) create mode 100644 io/tst-stat-layout-time64-legacy.c create mode 100644 io/tst-stat-layout-time64.c diff --git a/io/Makefile b/io/Makefile index 2a5b4dcb..41d5e414 100644 --- a/io/Makefile +++ b/io/Makefile @@ -245,12 +245,21 @@ tests-time64 := \ tst-lchmod-time64 \ tst-lstat-nofollow-time64 \ tst-lutimes-time64 \ + tst-stat-layout-time64 \ tst-stat-time64 \ tst-utime-time64 \ tst-utimensat-time64 \ tst-utimes-time64 \ # tests-time64 +test-extras += \ + tst-stat-layout-time64-legacy \ + # test-extras + +extra-test-objs += \ + tst-stat-layout-time64-legacy.o \ + # extra-test-objs + # Likewise for statx, but we do not need static linking here. tests-internal += \ tst-file_change_detection \ @@ -270,6 +279,12 @@ endif include ../Rules +$(objpfx)tst-stat-layout-time64: \ + $(objpfx)tst-stat-layout-time64-legacy.o + +CFLAGS-tst-stat-layout-time64-legacy.c += \ + -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 + CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables diff --git a/io/tst-stat-layout-time64-legacy.c b/io/tst-stat-layout-time64-legacy.c new file mode 100644 index 00000000..1694b3d3 --- /dev/null +++ b/io/tst-stat-layout-time64-legacy.c @@ -0,0 +1,35 @@ +/* Return the time64 stat layout in POSIX.1-2001 mode. + Copyright (C) 2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#undef _GNU_SOURCE +#define _POSIX_C_SOURCE 200112L + +#include +#include + +size_t +stat_ctime_offset_with_posix_2001 (void) +{ + return offsetof (struct stat, st_ctime); +} + +size_t +stat_ctimensec_offset_with_posix_2001 (void) +{ + return offsetof (struct stat, st_ctimensec); +} diff --git a/io/tst-stat-layout-time64.c b/io/tst-stat-layout-time64.c new file mode 100644 index 00000000..52b19b48 --- /dev/null +++ b/io/tst-stat-layout-time64.c @@ -0,0 +1,36 @@ +/* Check that feature-test macros do not change the time64 stat layout. + Copyright (C) 2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +size_t stat_ctime_offset_with_posix_2001 (void); +size_t stat_ctimensec_offset_with_posix_2001 (void); + +static int +do_test (void) +{ + TEST_COMPARE (offsetof (struct stat, st_ctime), + stat_ctime_offset_with_posix_2001 ()); + TEST_COMPARE (offsetof (struct stat, st_ctim.tv_nsec), + stat_ctimensec_offset_with_posix_2001 ()); + return 0; +} + +#include diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h index e0b78b31..1399f3f4 100644 --- a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +#include + /* Content of internal __stat64_t64 struct. */ __dev_t st_dev; /* Device. */ __ino64_t st_ino; /* file serial number. */ From patchwork Wed Aug 5 08:03:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Goergens X-Patchwork-Id: 140630 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3124B4BB24CB for ; Wed, 5 Aug 2026 08:05:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3124B4BB24CB Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=ll0RZ4PS X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 1C10D4BAE7D3 for ; Wed, 5 Aug 2026 08:03:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C10D4BAE7D3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1C10D4BAE7D3 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785916992; cv=none; b=x6JNXk8DQG2BsYXcA8EeWmYKY7ZXepF2puSNUghM2SzRyJ0Xy7fmnsWAmwRXOp1+ayz0XvxHR+FuomA/EFyK09f+y/lmNZ99XwgF1yvDcLf5oNQ4mkqAEeTa52l68c36v9AufDakSyimw4pNr0PgCVfEMwv9Co28z1AIPoK/k7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785916992; c=relaxed/simple; bh=63p7yJiuW2W7ww1GgqbeUVOmaNLwtW85aiE07Ztds8w=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EY95LJZnA8UmL9CpJkyjBYsjcw7TeYZyLg3nFo6IbUjIZgina5QNpDXnGl39bwNJCksrVwVhUxrMmJUr8OFB+GTeuXAr4fsdn/4VInZMymxwiTfocT03fc+rwNHyv0tTF3GWAKJVE+rm0gyLrk33RHRn8rKM5gRTgGjx92GAz8s= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=ll0RZ4PS DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C10D4BAE7D3 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-c9c26a5fb98so577426a12.0 for ; Wed, 05 Aug 2026 01:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785916991; x=1786521791; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tpJ6NBADHWWK6Ha8i+6vpCxG77P/HS7YQiUTGG/+658=; b=ll0RZ4PS8vEKTADJfNs/aXz/9sVT9qCgCkwngzvgR6P2Y1NLV44MfpGHdyinK2h5FX nAt3hHCRAsOt2Ock5aurEtPZz0lOwcCTtsn54GjdJxykmQNPvvqKN7L2nJU7nMFZzXUy ALgdeA1eHcrGP5MoTMVluG+NwcUzAZc8cF5GMPQJbIjpaU18JdtkmZo91rbEwmxtzLv7 ftyFUh7xvxTVjBTCGwokGtqy0+ONlCbHrPHO+6BNZDUmINJ7MlpZ3pLlMSxM1k8dfx/Q Lu4FIhNYmj1R6/7C9V1pFz2Nq6HfrrCI8pSB7r07DhZ2z5wcmDVoafDkWQs9ZWx+vPg2 tUeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785916991; x=1786521791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tpJ6NBADHWWK6Ha8i+6vpCxG77P/HS7YQiUTGG/+658=; b=nHoikBSpEvnbrozebi4VfI5NoVYQ2GEPYW43aOkyD6jNszhomlVkBMCqfZmF+jA+Mv 3XWmcra5xOXROqm8Xm2/u4+v2GWR7Vq2tTSQvneYwkPo/mbSs5nNR/bo2gDX6ACTQJnb jvvZHqGV1rHclGxPiXQoaK2Un10iJjEJv3BlaYyll5bM/vowJAvueAUNEmhu8DkHsdJQ vtqNcbXHyX6mnaDqSklPC2sqGUOl3SSLZU8ZhMa78hv5nNMXJ/oO8sxYFYXrFr7jZDdn APGW3N1GoSsSHgHAy6hjKlAb+y7bcdWIZqCBtYBXhL0ObTFJuhgudCY4RGptrms3VYMP PviA== X-Gm-Message-State: AOJu0Yx76O70N6VIxhg2P4cLml0hwmtOOLSFJGoRve58QUR02vHeB5rw H5kP9Vaxd2MFYmHoAqXVygbzgmIeXxXDXrl2UwFEovv/7BdMYmmiiSawkx3lhFUy X-Gm-Gg: AR+sD11TLoaTz34DlL4Y+T8taM5/A8RSDzeM+WhiKfqkhLF92SW2yZyMw1TryBzQpLE vrdPAB5OpvaRJeho+2ikd/Kbx2F6Ua8IQTWjQTGXCsZk+vbVPkUYAt5ODflZ+zH/yDPWprCnn6O 3dp9LBvUZcF86EOAhITSR14QofOjxKXt3sDesMBnhk0P9sA4PcOJT6l2CALqJcCmgCPz9Txw/iM yHlRETTrJ+7iboqOqqLyAeZS5VubJrwHboIFZonFjKR7ogjjG5+sOr2YZY1QiYRC8GL7VIO9Kp0 v+YF2V6I7LsTSUEQshUuQI1HeoE/nLGKOjK1WwK6bPE0l/0D3+IjzV30clFM8+CiIgfYUPsjNez zz0Je5N1OIqSqCaMlpLNU8RaB5J3nX4lJHfL/5kjuJ+zHRlbfQwG/+VNX5VkAWAOES1dz043U/2 l9+OwUILug64Rs3zyxc/5FXdocymE4T1x7HRLoMlBAnrJ44j2+7ymVqMWr7ArFiNOGfW8kgJyg3 GfSxFxmX0vFuvN1q2c7n0zALaJccC7zBw+TWWF4V5KEghMweRGymgPEnKWXTpJwnFMlTfPYThAG /Tb+Ry/IiJL2uTHUtTTz5VV+qmKcYv8+KvmZr0RUSfR3wr5dVojDFL/+U0sy20Y= X-Received: by 2002:a05:6a21:1bc7:b0:3c3:d298:81b2 with SMTP id adf61e73a8af0-3cb858dc65emr6064301637.1.1785916991062; Wed, 05 Aug 2026 01:03:11 -0700 (PDT) Received: from spider.bream-herring.ts.net ([103.252.203.158]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbe707cab37sm973517a12.7.2026.08.05.01.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 01:03:10 -0700 (PDT) From: Matthias Goergens To: libc-alpha@sourceware.org Cc: Matthias Goergens Subject: [PATCH 2/2] linux: Keep time64 stat size independent of feature macros [BZ #32119] Date: Wed, 5 Aug 2026 16:03:04 +0800 Message-ID: <20260805080304.3535401-3-matthias.goergens@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260805080304.3535401-1-matthias.goergens@gmail.com> References: <20260805080304.3535401-1-matthias.goergens@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@sourceware.org The time64 stat helper adds two reserved words only when POSIX.1-2008 interfaces are hidden. This makes the public structure larger under an older feature-test macro, although stat does not populate these fields. Remove the reserved words and compare sizes in the feature-mode test. This restores the strict-mode layout used before the helper refactoring and matches the default and internal time64 layouts. Signed-off-by: Matthias Goergens --- io/tst-stat-layout-time64-legacy.c | 6 ++++++ io/tst-stat-layout-time64.c | 2 ++ sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h | 3 --- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/io/tst-stat-layout-time64-legacy.c b/io/tst-stat-layout-time64-legacy.c index 1694b3d3..b5547aaa 100644 --- a/io/tst-stat-layout-time64-legacy.c +++ b/io/tst-stat-layout-time64-legacy.c @@ -33,3 +33,9 @@ stat_ctimensec_offset_with_posix_2001 (void) { return offsetof (struct stat, st_ctimensec); } + +size_t +stat_size_with_posix_2001 (void) +{ + return sizeof (struct stat); +} diff --git a/io/tst-stat-layout-time64.c b/io/tst-stat-layout-time64.c index 52b19b48..62d82eb6 100644 --- a/io/tst-stat-layout-time64.c +++ b/io/tst-stat-layout-time64.c @@ -22,6 +22,7 @@ size_t stat_ctime_offset_with_posix_2001 (void); size_t stat_ctimensec_offset_with_posix_2001 (void); +size_t stat_size_with_posix_2001 (void); static int do_test (void) @@ -30,6 +31,7 @@ do_test (void) stat_ctime_offset_with_posix_2001 ()); TEST_COMPARE (offsetof (struct stat, st_ctim.tv_nsec), stat_ctimensec_offset_with_posix_2001 ()); + TEST_COMPARE (sizeof (struct stat), stat_size_with_posix_2001 ()); return 0; } diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h index 1399f3f4..0ce85352 100644 --- a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h @@ -61,8 +61,5 @@ __fieldts64 (st_mtime); __fieldts64 (st_ctime); - unsigned long int __glibc_reserved4; - unsigned long int __glibc_reserved5; - # undef __fieldts64 #endif