From 8a04c4d84c8a1a1297ec0c5cec5522112981e0c0 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 23 Oct 2019 13:57:27 +0200 Subject: csky: add statx conditionals Similar to glibc commit https://sourceware.org/git/?p=glibc.git;a=commit;h=6bbfc5c09fc5b5e3d4a0cddbbd4e2e457767dae7 we need to handle Linux kernel change, which removed stat64 family from default syscall set. Signed-off-by: Waldemar Brodkorb Signed-off-by: Waldemar Brodkorb --- libc/sysdeps/linux/common/lstat64.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libc/sysdeps/linux/common/lstat64.c') diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c index 2f66e7ca2..61892994e 100644 --- a/libc/sysdeps/linux/common/lstat64.c +++ b/libc/sysdeps/linux/common/lstat64.c @@ -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 +# include + +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" -- cgit v1.2.3