feat(dirent): directory iteration

This commit is contained in:
2026-09-05 21:08:57 -04:00
parent a2f7c33601
commit 5af4197ee9
14 changed files with 1139 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <dirent.h>
#include "dirent_impl.h"
/*
* telldir (todo 24): return the stream's current directory location.
* readdir stores the kernel's d_off cookie of every entry it hands out —
* the offset at which iteration resumes AFTER that entry — so the cookie
* of the most recently returned entry is exactly the location a matching
* seekdir must restore. A fresh or rewound stream reports 0, the start.
*/
long
telldir(DIR *dir)
{
struct vlibc_DIR *d = dir;
return (long)d->de.d_off;
}