From: Markos Chandras <markos.chand...@imgtec.com>

Signed-off-by: Markos Chandras <markos.chand...@imgtec.com>
---
 libc/sysdeps/linux/common/lstat64.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libc/sysdeps/linux/common/lstat64.c 
b/libc/sysdeps/linux/common/lstat64.c
index 85e2698..6884b3f 100644
--- a/libc/sysdeps/linux/common/lstat64.c
+++ b/libc/sysdeps/linux/common/lstat64.c
@@ -10,11 +10,20 @@
 #include <_lfs_64.h>
 #include <sys/syscall.h>
 
-#ifdef __NR_lstat64
+# include <fcntl.h>
 # include <unistd.h>
 # include <sys/stat.h>
 # include "xstatconv.h"
 
+#if defined(__NR_fstatat64) && !defined(__NR_lstat64)
+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)
 # define __NR___syscall_lstat64 __NR_lstat64
 static __always_inline _syscall2(int, __syscall_lstat64, const char *, 
file_name,
                                 struct kernel_stat64 *, buf)
-- 
1.8.1.1


_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to