summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/linux/getdents.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/linux/getdents.c')
-rw-r--r--libc-top-half/musl/src/linux/getdents.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/linux/getdents.c b/libc-top-half/musl/src/linux/getdents.c
new file mode 100644
index 0000000..796c1e5
--- /dev/null
+++ b/libc-top-half/musl/src/linux/getdents.c
@@ -0,0 +1,12 @@
+#define _BSD_SOURCE
+#include <dirent.h>
+#include <limits.h>
+#include "syscall.h"
+
+int getdents(int fd, struct dirent *buf, size_t len)
+{
+ if (len>INT_MAX) len = INT_MAX;
+ return syscall(SYS_getdents, fd, buf, len);
+}
+
+weak_alias(getdents, getdents64);