summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/lstat64.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/lstat64.c')
-rw-r--r--libc/sysdeps/linux/common/lstat64.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c
index 2f66e7ca2..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)
@@ -29,6 +29,23 @@ int lstat64(const char *file_name, struct stat64 *buf)
}
libc_hidden_def(lstat64)
+#elif defined __NR_statx && defined __UCLIBC_HAVE_STATX__
+# include <fcntl.h>
+# include <statx_cp.h>
+
+int lstat64(const char *file_name, struct stat64 *buf)
+{
+ struct statx tmp;
+ int rc = INLINE_SYSCALL (statx, 5, AT_FDCWD, file_name,
+ AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW,
+ STATX_BASIC_STATS, &tmp);
+ if (rc == 0)
+ __cp_stat64_statx ((struct stat64 *)buf, &tmp);
+
+ return rc;
+}
+libc_hidden_def(lstat64)
+
/* For systems which have both, prefer the old one */
#elif defined __NR_lstat64
# include "xstatconv.h"