summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/stat64.c
diff options
context:
space:
mode:
authorDmitry Chestnykh <dm.chestnykh@gmail.com>2024-02-26 22:13:22 +0300
committerWaldemar Brodkorb <wbx@openadk.org>2024-02-27 02:34:47 +0100
commitee7e012b71dd3a964dc8bd3a82acddc24aceebc7 (patch)
treeebbbb38d00ba688be62d129191c87998bf2e24a4 /libc/sysdeps/linux/common/stat64.c
parent73017bba9d3bc0f8ada159319ff590117c9e5689 (diff)
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 <dm.chestnykh@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common/stat64.c')
-rw-r--r--libc/sysdeps/linux/common/stat64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c
index 47d938b11..fdd2c49a9 100644
--- a/libc/sysdeps/linux/common/stat64.c
+++ b/libc/sysdeps/linux/common/stat64.c
@@ -30,7 +30,7 @@ int stat64(const char *file_name, struct stat64 *buf)
int rc = INLINE_SYSCALL (statx, 5, AT_FDCWD, file_name, AT_NO_AUTOMOUNT,
STATX_BASIC_STATS, &tmp);
if (rc == 0)
- __cp_stat_statx ((struct stat64 *)buf, &tmp);
+ __cp_stat64_statx ((struct stat64 *)buf, &tmp);
return rc;
}