From bd5827f470708dae107797998ccd3022d52f1a9d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 4 Feb 2006 02:17:00 +0000 Subject: use just __getdents64 rather than either __getdents and __getdents64 when possible (saves space and gives us access to d_type most of the time) --- libc/sysdeps/linux/common/getdents64.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libc/sysdeps/linux/common/getdents64.c') 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 #include -#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__ */ -- cgit v1.2.3