From: Markos Chandras <[email protected]>

Signed-off-by: Markos Chandras <[email protected]>
---
 libc/sysdeps/linux/common/fstat.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/libc/sysdeps/linux/common/fstat.c 
b/libc/sysdeps/linux/common/fstat.c
index 4726a68..cf69580 100644
--- a/libc/sysdeps/linux/common/fstat.c
+++ b/libc/sysdeps/linux/common/fstat.c
@@ -12,6 +12,22 @@
 #include <sys/stat.h>
 #include "xstatconv.h"
 
+#if defined(__NR_fstat64) && !defined(__NR_fstat)
+int fstat(int fd, struct stat *buf)
+{
+       int result;
+       struct kernel_stat64 kbuf;
+
+       result = INLINE_SYSCALL(fstat64, 2, fd, &kbuf);
+
+       if (result == 0)
+               __xstat32_conv(&kbuf, buf);
+
+       return result;
+}
+libc_hidden_def(fstat)
+
+#elif defined(__NR_fstat)
 int fstat(int fd, struct stat *buf)
 {
        int result;
@@ -38,7 +54,9 @@ int fstat(int fd, struct stat *buf)
 }
 libc_hidden_def(fstat)
 
-#if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
+#if ! defined (__NR_fstat64) && defined __UCLIBC_HAS_LFS__
 strong_alias_untyped(fstat,fstat64)
 libc_hidden_def(fstat64)
 #endif
+
+#endif
-- 
1.8.0


_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to