From 789e2402f34dcc72a17f58be3227d12e9da12a21 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 11 Oct 2012 12:30:56 +0100 Subject: lstat64: Use fstatat64 if arch does not have the lstat64 syscall Signed-off-by: Markos Chandras Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/lstat64.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (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 85e269819..c43e53e1d 100644 --- a/libc/sysdeps/linux/common/lstat64.c +++ b/libc/sysdeps/linux/common/lstat64.c @@ -10,11 +10,21 @@ #include <_lfs_64.h> #include -#ifdef __NR_lstat64 # include # include -# include "xstatconv.h" +#if defined __NR_fstatat64 && !defined __NR_lstat64 +# include + +int lstat64(const char *file_name, struct stat64 *buf) +{ + return fstatat64(AT_FDCWD, file_name, buf, AT_SYMLINK_NOFOLLOW); +} +libc_hidden_def(lstat64) + +/* For systems which have both, prefer the old one */ +#elif defined __NR_lstat64 +# include "xstatconv.h" # define __NR___syscall_lstat64 __NR_lstat64 static __always_inline _syscall2(int, __syscall_lstat64, const char *, file_name, struct kernel_stat64 *, buf) -- cgit v1.2.3