aboutsummaryrefslogtreecommitdiff
path: root/lib/sys/getdents.h
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-01-15 01:13:51 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-01-15 01:13:51 +0100
commit3f79b7bd553a52fca7a098f5195b406ff9970491 (patch)
tree99d0399141e7894219fe7a0deed1ccadb226b9c9 /lib/sys/getdents.h
parent919450dc7d965c4067287e1ece3ceafdde8ff5a9 (diff)
add list and static library builder
Diffstat (limited to 'lib/sys/getdents.h')
-rw-r--r--lib/sys/getdents.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/sys/getdents.h b/lib/sys/getdents.h
new file mode 100644
index 0000000..b5a0c74
--- /dev/null
+++ b/lib/sys/getdents.h
@@ -0,0 +1,18 @@
+#ifndef GETDENTS_H
+#define GETDENTS_H
+
+#include "syscalls.h"
+
+struct dirent {
+ unsigned long d_ino;
+ unsigned long d_off;
+ unsigned short d_reclen;
+ char d_name[];
+};
+
+static int getdents(unsigned int fd, char *buf, unsigned int count)
+{
+ return syscall(GETDENTS, fd, buf, count);
+}
+
+#endif