summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/getdents64.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-04 02:17:00 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-04 02:17:00 +0000
commitbd5827f470708dae107797998ccd3022d52f1a9d (patch)
tree6251c5c0514d267e118d1feb8bfeb64927a6d1ec /libc/sysdeps/linux/common/getdents64.c
parentcfdee7ee021f45da878500d0a40c2a03fe99303a (diff)
downloaduClibc-alpine-bd5827f470708dae107797998ccd3022d52f1a9d.tar.bz2
uClibc-alpine-bd5827f470708dae107797998ccd3022d52f1a9d.tar.xz
use just __getdents64 rather than either __getdents and __getdents64 when possible (saves space and gives us access to d_type most of the time)
Diffstat (limited to 'libc/sysdeps/linux/common/getdents64.c')
-rw-r--r--libc/sysdeps/linux/common/getdents64.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c
index aa30bd661..da193ebab 100644
--- a/libc/sysdeps/linux/common/getdents64.c
+++ b/libc/sysdeps/linux/common/getdents64.c
@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <sys/syscall.h>
-#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
libc_hidden_proto(memcpy)
libc_hidden_proto(lseek64)
@@ -94,10 +94,9 @@ ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes)
}
return (char *) dp - buf;
}
-#else
-extern ssize_t __getdents (int fd, char *buf, size_t nbytes) attribute_hidden;
-ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes)
-{
- return(__getdents(fd, buf, nbytes));
-}
+
+/* since getdents doesnt give us d_type but getdents64 does, try and
+ * use getdents64 as much as possible */
+attribute_hidden strong_alias(__getdents64,__getdents)
+
#endif /* __UCLIBC_HAS_LFS__ */