diff 79dbce6b393f547711bd0fed16a97c08087c4446 uncommitted --- a/sys/include/ape/dirent.h +++ b/sys/include/ape/dirent.h @@ -38,6 +38,8 @@ struct dirent *readdir(DIR *); void rewinddir(DIR *); int closedir(DIR *); +long telldir(DIR *); +void seekdir(DIR *, long); #ifdef __cplusplus } --- a/sys/src/ape/lib/ap/plan9/opendir.c +++ b/sys/src/ape/lib/ap/plan9/opendir.c @@ -123,3 +123,15 @@ d->dd_loc += sizeof(struct dirent); return dr; } + +long +telldir(DIR *d) +{ + return d->dd_loc; +} + +void +seekdir(DIR *d, long loc) +{ + d->dd_loc = loc; +}