diff mbox series

[uclibc-ng-devel,2/3] libc: always redirect *stat() family to statx() with time64 enabled.

Message ID 20240228084509.2212329-2-dm.chestnykh@gmail.com
State Accepted
Headers show
Series [uclibc-ng-devel,1/3] ldso: Use statx() when time64 is enabled. | expand

Commit Message

Dmitry Chestnykh Feb. 28, 2024, 8:45 a.m. UTC
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
---
 libc/sysdeps/linux/common/fstat64.c   | 2 +-
 libc/sysdeps/linux/common/fstatat64.c | 4 ++--
 libc/sysdeps/linux/common/lstat64.c   | 2 +-
 libc/sysdeps/linux/common/stat64.c    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libc/sysdeps/linux/common/fstat64.c b/libc/sysdeps/linux/common/fstat64.c
index 20a9acf01..359c22af6 100644
--- a/libc/sysdeps/linux/common/fstat64.c
+++ b/libc/sysdeps/linux/common/fstat64.c
@@ -9,7 +9,7 @@ 
 #include <_lfs_64.h>
 #include <sys/syscall.h>
 
-#ifdef __NR_fstat64
+#if defined(__NR_fstat64) && !defined(__UCLIBC_USE_TIME64__)
 # include <unistd.h>
 # include <sys/stat.h>
 # include "xstatconv.h"
diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c
index fdd17a0b7..16dbf9215 100644
--- a/libc/sysdeps/linux/common/fstatat64.c
+++ b/libc/sysdeps/linux/common/fstatat64.c
@@ -23,7 +23,7 @@ 
 # define __NR_fstatat64 __NR_newfstatat
 #endif
 
-#ifdef __NR_fstatat64
+#if defined(__NR_fstatat64) && !defined(__UCLIBC_USE_TIME64__)
 # include <sys/stat.h>
 # include "xstatconv.h"
 int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
@@ -57,7 +57,7 @@  int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
 			       STATX_BASIC_STATS, &tmp);
 
 	if (r == 0)
-		__cp_stat64_statx ((struct stat *)buf, &tmp);
+		__cp_stat64_statx ((struct stat64 *)buf, &tmp);
 
 	return r;
 }
diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c
index 61892994e..efc5b1b7f 100644
--- a/libc/sysdeps/linux/common/lstat64.c
+++ b/libc/sysdeps/linux/common/lstat64.c
@@ -11,7 +11,7 @@ 
 #include <unistd.h>
 #include <sys/stat.h>
 
-#if defined __NR_fstatat64 && !defined __NR_lstat
+#if defined __NR_fstatat64 && !defined __NR_lstat && !defined(__UCLIBC_USE_TIME64__)
 # include <fcntl.h>
 
 int lstat64(const char *file_name, struct stat64 *buf)
diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c
index fdd2c49a9..0875ba39d 100644
--- a/libc/sysdeps/linux/common/stat64.c
+++ b/libc/sysdeps/linux/common/stat64.c
@@ -10,7 +10,7 @@ 
 #include <sys/syscall.h>
 #include <sys/stat.h>
 
-#if defined __NR_fstatat64 && !defined __NR_stat64
+#if defined __NR_fstatat64 && !defined __NR_stat64 && !defined(__UCLIBC_USE_TIME64__)
 #include <fcntl.h>
 #include <unistd.h>