aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-09-25 14:22:22 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-09-25 14:22:22 -0700
commit72fdbfde418c3496ffe810fbb0fb5f48adcf2a0f (patch)
treed2e7f0dc2c12458a97e877c4dfc122b5fae46b7e /system
parent0d423cd35b930cbc70806e90a4583ad70d552a11 (diff)
fix dirent.h and folders test
Diffstat (limited to 'system')
-rw-r--r--system/include/libc/dirent.h3
-rw-r--r--system/include/libc/sys/dirent.h18
2 files changed, 19 insertions, 2 deletions
diff --git a/system/include/libc/dirent.h b/system/include/libc/dirent.h
index 6fefc03c..97700f30 100644
--- a/system/include/libc/dirent.h
+++ b/system/include/libc/dirent.h
@@ -3,12 +3,13 @@
#ifdef __cplusplus
extern "C" {
#endif
-#include <sys/dirent.h>
#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE)
#define MAXNAMLEN 1024
#endif
+#include <sys/dirent.h>
+
#ifdef __cplusplus
}
#endif
diff --git a/system/include/libc/sys/dirent.h b/system/include/libc/sys/dirent.h
index a3fb5c02..5dc42ebe 100644
--- a/system/include/libc/sys/dirent.h
+++ b/system/include/libc/sys/dirent.h
@@ -7,7 +7,23 @@
#ifdef __cplusplus
extern "C" {
#endif
-#error "<dirent.h> not supported"
+
+struct DIR;
+
+/* XXX Emscripten */
+struct dirent {
+ ino_t d_ino;
+ char d_name[MAXNAMLEN];
+ int d_off;
+ int d_reclen;
+ char d_type;
+};
+
+DIR *opendir(const char *);
+void seekdir(DIR *, long);
+long telldir(DIR *);
+struct dirent *readdir(DIR *);
+
#ifdef __cplusplus
}
#endif