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/stat.c | 15 ++++++++++++++- 1 file changed, 14 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 6489d229b..a860c0c7f 100644 --- a/libc/sysdeps/linux/common/stat.c +++ b/libc/sysdeps/linux/common/stat.c @@ -27,7 +27,20 @@ int stat(const char *file_name, struct stat *buf) { return fstatat64(AT_FDCWD, file_name, buf, 0); } +#elif __NR_statx && defined __UCLIBC_HAVE_STATX__ +# include +# include +int stat(const char *file_name, struct stat *buf) +{ + struct statx tmp; + int rc = INLINE_SYSCALL (statx, 5, AT_FDCWD, file_name, AT_NO_AUTOMOUNT, + STATX_BASIC_STATS, &tmp); + if (rc == 0) + __cp_stat_statx ((struct stat *)buf, &tmp); + + return rc; +} #else # include "xstatconv.h" @@ -58,7 +71,7 @@ int stat(const char *file_name, struct stat *buf) #endif /* __NR_fstat64 */ libc_hidden_def(stat) -#if ! defined __NR_stat64 && ! defined __NR_fstatat64 +#if ! defined __NR_stat64 && ! defined __NR_fstatat64 && ! defined __UCLIBC_HAVE_STATX__ strong_alias_untyped(stat,stat64) libc_hidden_def(stat64) #endif -- cgit v1.2.3