about summary refs log tree commit diff
path: root/src/dirent/seekdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dirent/seekdir.c')
-rw-r--r--src/dirent/seekdir.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dirent/seekdir.c b/src/dirent/seekdir.c
new file mode 100644
index 00000000..81a0e331
--- /dev/null
+++ b/src/dirent/seekdir.c
@@ -0,0 +1,12 @@
+#include <dirent.h>
+#include <unistd.h>
+#include "__dirent.h"
+#include "libc.h"
+
+void seekdir(DIR *dir, long off)
+{
+	LOCK(&dir->lock);
+	dir->tell = lseek(dir->fd, off, SEEK_SET);
+	dir->buf_pos = dir->buf_end = 0;
+	UNLOCK(&dir->lock);
+}