summaryrefslogtreecommitdiff
path: root/src/dirent
diff options
context:
space:
mode:
Diffstat (limited to 'src/dirent')
-rw-r--r--src/dirent/posix_getdents.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dirent/posix_getdents.c b/src/dirent/posix_getdents.c
new file mode 100644
index 00000000..26c16ac6
--- /dev/null
+++ b/src/dirent/posix_getdents.c
@@ -0,0 +1,11 @@
+#include <dirent.h>
+#include <limits.h>
+#include <errno.h>
+#include "syscall.h"
+
+ssize_t posix_getdents(int fd, void *buf, size_t len, int flags)
+{
+ if (flags) return __syscall_ret(-EOPNOTSUPP);
+ if (len>INT_MAX) len = INT_MAX;
+ return syscall(SYS_getdents, fd, buf, len);
+}