From ee7e012b71dd3a964dc8bd3a82acddc24aceebc7 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Mon, 26 Feb 2024 22:13:22 +0300 Subject: Fix *stat() and *stat64() when the time is beyond year 2038. To obtain correct `st_atim`, `st_mtim` and `st_ctim` fields we need to use statx() syscall and then convert the data from the kernel to the regular stat structure. Signed-off-by: Dmitry Chestnykh --- libc/sysdeps/linux/common/stat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common/stat.c') diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c index 99ce8d2dd..42f39aea6 100644 --- a/libc/sysdeps/linux/common/stat.c +++ b/libc/sysdeps/linux/common/stat.c @@ -9,10 +9,11 @@ #include #include #include +#include #undef stat -#if defined __NR_fstatat64 && !defined __NR_stat +#if defined __NR_fstatat64 && !defined __NR_stat && !defined(__UCLIBC_USE_TIME64__) # include int stat(const char *file_name, struct stat *buf) -- cgit v1.2.3