9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

commit d2a6d3b9d5cc69cfb0fe09604217280d4093f21c
parent 0ebf0433351f6e6fd61c5bfc25d5d4bd685f7b3a
Author: anselm@garbe.us <unknown>
Date:   Wed,  7 Mar 2012 21:34:14 +0100

applied Matthew's dirread patch, thanks
Diffstat:
lib9/dirread.c | 23++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/lib9/dirread.c b/lib9/dirread.c @@ -3,26 +3,23 @@ #include <libc.h> #include <sys/stat.h> #include <dirent.h> -#if defined(__linux__) && (__UCLIBC__) + +#if defined (__UCLIBC__) # include <sys/syscall.h> +# if defined (__USE_LARGEFILE64) +# define getdents SYS_getdents64 +# else +# define getdents SYS_getdents +# endif #endif extern int _p9dir(struct stat*, struct stat*, char*, Dir*, char**, char*); #if defined(__linux__) -# if defined(__UCLIBC__) -/* uClibc doesn't provide getdirentries(2), getdents(2) isn't wrapped - * by uClibc either. So we are using getdents(2) syscall directly. - */ -# warning "uClibc based system are using getdents(2) syscall directly." +# if defined (__UCLIBC__) static int -mygetdents(int fd, struct dirent *buf, int n) -{ -# if defined(__USE_LARGEFILE64) - return syscall(SYS_getdents64, fd, (void*)buf, n); -# else - return syscall(SYS_getdents, fd, (void*)buf, n); -# endif +mygetdents(int fd, struct dirent *buf, int n) { + return syscall (getdents, fd, (void*) buf, n); } # else static int