From patchwork Sat Jul 27 10:06:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 1965642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=gmx.net header.i=j.neuschaefer@gmx.net header.a=rsa-sha256 header.s=s31663417 header.b=l5C1OoEy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (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 4WWP7Z4QKJz1yYc for ; Sat, 27 Jul 2024 22:29:12 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 06CCA35211EC; Sat, 27 Jul 2024 14:29:04 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=gmx.net header.i=j.neuschaefer@gmx.net header.a=rsa-sha256 header.s=s31663417 header.b=l5C1OoEy; dkim-atps=neutral Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by helium.openadk.org (Postfix) with ESMTPS id 6366E35211AB for ; Sat, 27 Jul 2024 12:06:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1722074779; x=1722679579; i=j.neuschaefer@gmx.net; bh=FPV5NgS9Lk44QV/iVBYZEWOQvNbI62oYXkgLfTif7Qw=; h=X-UI-Sender-Class:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:To:Cc:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=l5C1OoEyk8td62/B8gjdmdLYqElfHOWPHD07mOtpriplu2hhxbJ+cWSBEJuT+oQp KZX9aluKsrp4dpnfbT0KudCZcFJ5RtsYQwArySkpp2xqNNZo6f6G7QhGu8gVY3N9b jIwwhZUVrK0oNGPShQP7O0mOFXQSJdF/nMKsCGxQEXpwTXmpYtcLX9fu+cDDfFkb8 mji4qui7p4U1+LEUSXeSWWTJCXWUjTvAHDVk7XaXAv8xdiZozXmbhJ2SF8EkZMpUk jwmnNXdFrOOMxpf7k+bA73KgJyHZvGQ3tCHWRiftEAYMiMNP9rzWugJq6kfwrJkMm mxSK4Zqnyb4z9O3KEw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from probook ([89.1.58.183]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N6sn7-1sDQLE1WQx-00vbzb; Sat, 27 Jul 2024 12:06:19 +0200 From: =?utf-8?q?J=2E_Neusch=C3=A4fer?= Date: Sat, 27 Jul 2024 12:06:17 +0200 MIME-Version: 1.0 Message-Id: <20240727-stat-v1-1-73212ba93d28@gmx.net> X-B4-Tracking: v=1; b=H4sIAJjGpGYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDcyNz3eKSxBJd47TEFNNkgxSjlLQkJaDSgqLUtMwKsDHRsbW1APQbSUF WAAAA To: devel@uclibc-ng.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722074778; l=9154; i=j.neuschaefer@gmx.net; s=20240329; h=from:subject:message-id; bh=eAmqKPeENgyyGkHNXQFFL86EhF3ef5WQPyD5ipJXCeE=; b=T8X6tTDkpZgt3Yof9/YU4PIearqX6C7suFBE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RNm/cQBK MD14fb7HqsVsxIG5rfbxVY8YG9ZLkCvfm74fOQUZQZG3FKOFP4T/uXwoXiWtiHBKFQSHIN4By L0Z+kfmoT9g8NNYuJc0vfboOQ8Q0NJm8K6JiS+qThIjt+igMWajFkSK054QovPaIrmFCYcfaU DiZirHawW5KR1MD0aa7lzjZdiy6g6rV7n4xoltkbQfl1wOLdMbKKpWFnXtEILYGJrbA82EJ+p sid6TQSuNq0gYQ4HWPt5rbNw== X-MailFrom: j.neuschaefer@gmx.net X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: 6PYTRMWIWWQ6HM6EIN3CXKGU7WZMLCBS X-Message-ID-Hash: 6PYTRMWIWWQ6HM6EIN3CXKGU7WZMLCBS X-Mailman-Approved-At: Sat, 27 Jul 2024 14:28:56 +0200 CC: Yann Sionneau , Fabrice Fontaine , =?utf-8?q?J=2E_Neusch=C3=A4f?= =?utf-8?q?er?= X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] bits/stat.h: Declare st_mtim if defined(__USE_XOPEN2K8), everywhere List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: While building software that sets _POSIX_C_SOURCE=200809L and uses stat.st_mtim for ARM, it was noticed that st_mtim was not defined. This seems to be because common/bits/stat.h was picked up, which does not take __USE_XOPEN2K8 as a reason to enable st_mtim and related fields. This appears to be an oversight, and porting the check from common-generic/bits/stat.h to other architectures does indeed fix the build issue. This patch is based on commit 50bd6d06e ("Fix memory corruption due to struct stat field"). Signed-off-by: J. Neuschäfer --- libc/sysdeps/linux/alpha/bits/stat.h | 2 +- libc/sysdeps/linux/common/bits/stat.h | 4 ++-- libc/sysdeps/linux/frv/bits/stat.h | 4 ++-- libc/sysdeps/linux/ia64/bits/stat.h | 4 ++-- libc/sysdeps/linux/m68k/bits/stat.h | 4 ++-- libc/sysdeps/linux/mips/bits/stat.h | 4 ++-- libc/sysdeps/linux/nds32/bits/stat.h | 4 ++-- libc/sysdeps/linux/powerpc/bits/stat.h | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) --- base-commit: 05b11809bd11450aff3d20e43f18415ce58601e7 change-id: 20240727-stat-3fad5c0d2dfb Best regards, -- J. Neuschäfer diff --git a/libc/sysdeps/linux/alpha/bits/stat.h b/libc/sysdeps/linux/alpha/bits/stat.h index 88bc6617d..f2dca250d 100644 --- a/libc/sysdeps/linux/alpha/bits/stat.h +++ b/libc/sysdeps/linux/alpha/bits/stat.h @@ -40,7 +40,7 @@ Use neat tidy anonymous unions and structures when possible. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) # if __GNUC_PREREQ(3,3) # define __ST_TIME(X) \ __extension__ union { \ diff --git a/libc/sysdeps/linux/common/bits/stat.h b/libc/sysdeps/linux/common/bits/stat.h index 07c09f50a..fc76cc3e7 100644 --- a/libc/sysdeps/linux/common/bits/stat.h +++ b/libc/sysdeps/linux/common/bits/stat.h @@ -61,7 +61,7 @@ struct stat #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -107,7 +107,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the diff --git a/libc/sysdeps/linux/frv/bits/stat.h b/libc/sysdeps/linux/frv/bits/stat.h index 381d207f2..18321c080 100644 --- a/libc/sysdeps/linux/frv/bits/stat.h +++ b/libc/sysdeps/linux/frv/bits/stat.h @@ -70,7 +70,7 @@ struct stat __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -117,7 +117,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the diff --git a/libc/sysdeps/linux/ia64/bits/stat.h b/libc/sysdeps/linux/ia64/bits/stat.h index 6723166e7..2b70b8cf8 100644 --- a/libc/sysdeps/linux/ia64/bits/stat.h +++ b/libc/sysdeps/linux/ia64/bits/stat.h @@ -38,7 +38,7 @@ struct stat int pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -77,7 +77,7 @@ struct stat64 int pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the diff --git a/libc/sysdeps/linux/m68k/bits/stat.h b/libc/sysdeps/linux/m68k/bits/stat.h index 7b9c3d144..70da1b384 100644 --- a/libc/sysdeps/linux/m68k/bits/stat.h +++ b/libc/sysdeps/linux/m68k/bits/stat.h @@ -60,7 +60,7 @@ struct stat #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -106,7 +106,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the diff --git a/libc/sysdeps/linux/mips/bits/stat.h b/libc/sysdeps/linux/mips/bits/stat.h index 539fa33d2..bad2a0244 100644 --- a/libc/sysdeps/linux/mips/bits/stat.h +++ b/libc/sysdeps/linux/mips/bits/stat.h @@ -60,7 +60,7 @@ struct stat long int st_pad2[2]; __off64_t st_size; /* Size of file, in bytes. */ #endif -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -103,7 +103,7 @@ struct stat { unsigned int st_rdev; /* Device number, if device. */ int st_pad2[3]; __off_t st_size; /* Size of file, in bytes. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the diff --git a/libc/sysdeps/linux/nds32/bits/stat.h b/libc/sysdeps/linux/nds32/bits/stat.h index c4e09e0f2..5272751f4 100644 --- a/libc/sysdeps/linux/nds32/bits/stat.h +++ b/libc/sysdeps/linux/nds32/bits/stat.h @@ -64,7 +64,7 @@ struct stat #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -110,7 +110,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the diff --git a/libc/sysdeps/linux/powerpc/bits/stat.h b/libc/sysdeps/linux/powerpc/bits/stat.h index 7494586b5..ce2ebf896 100644 --- a/libc/sysdeps/linux/powerpc/bits/stat.h +++ b/libc/sysdeps/linux/powerpc/bits/stat.h @@ -59,7 +59,7 @@ struct stat # else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ # endif -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -99,7 +99,7 @@ struct stat64 __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +#if defined(__USE_MISC) || defined(__USE_XOPEN2K8) /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the