\--- a/lib9/dirread.c	2012-02-28 23:09:24.000000000 +0100
+++ b/lib9/dirread.c	2012-02-28 23:22:48.000000000 +0100
@@ -4,9 +4,25 @@
 #include <sys/stat.h>
 #include <dirent.h>
 
+#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__)
+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 +34,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)
