From d0c8c185b439187b12644457bb2aa0326f25aaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Sat, 27 Jul 2024 18:47:09 +0200 Subject: bits/stat.h: Declare st_mtim if defined(__USE_XOPEN2K8), everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/alpha') 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 { \ -- cgit v1.2.3