[hackers] [9base] applied Matthew's dirread patch, thanks || anselm
changeset: 96:015de3370bb1
tag: tip
user: anselm_AT_garbe.us
date: Wed Mar 07 21:34:14 2012 +0100
files: lib9/dirread.c
description:
applied Matthew's dirread patch, thanks
diff -r 8ea978e371b8 -r 015de3370bb1 lib9/dirread.c
--- a/lib9/dirread.c Wed Mar 07 21:29:55 2012 +0100
+++ b/lib9/dirread.c Wed Mar 07 21:34:14 2012 +0100
_AT_@ -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
Received on Wed Mar 07 2012 - 20:33:14 CET
This archive was generated by hypermail 2.3.0
: Wed Mar 07 2012 - 20:36:11 CET