diff -r 3c9842ed0141 lib9/dirread.c --- a/lib9/dirread.c Wed Feb 29 20:52:27 2012 +0100 +++ b/lib9/dirread.c Fri Mar 02 22:35:09 2012 -0500 @@ -4,9 +4,24 @@ #include #include +#if defined (__UCLIBC__) +# include +# 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__) +static int +mygetdents(int fd, struct dirent *buf, int n) { + return syscall (getdents, fd, (void*) buf, n); +} +# else static int mygetdents(int fd, struct dirent *buf, int n) { @@ -18,6 +33,7 @@ nn = getdirentries(fd, (void*)buf, n, &off); return nn; } +# endif #elif defined(__APPLE__) || defined(__FreeBSD__) static int mygetdents(int fd, struct dirent *buf, int n)