diff options
Diffstat (limited to 'libc/sysdeps/linux/common/stat64.c')
-rw-r--r-- | libc/sysdeps/linux/common/stat64.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c index ef365c7e7..47d938b11 100644 --- a/libc/sysdeps/linux/common/stat64.c +++ b/libc/sysdeps/linux/common/stat64.c @@ -20,6 +20,22 @@ int stat64(const char *file_name, struct stat64 *buf) } libc_hidden_def(stat64) +#elif __NR_statx && defined __UCLIBC_HAVE_STATX__ +# include <fcntl.h> +# include <statx_cp.h> + +int stat64(const char *file_name, struct stat64 *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 stat64 *)buf, &tmp); + + return rc; +} +libc_hidden_def(stat64) + /* For systems which have both, prefer the old one */ # elif defined __NR_stat64 # define __NR___syscall_stat64 __NR_stat64 |