diff options
Diffstat (limited to 'src/lib9/dirread.c')
-rw-r--r-- | src/lib9/dirread.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib9/dirread.c b/src/lib9/dirread.c index 5151b132..d19429e8 100644 --- a/src/lib9/dirread.c +++ b/src/lib9/dirread.c @@ -11,6 +11,21 @@ extern int _p9dir(struct stat*, char*, Dir*, char**, char*); +#if !defined(_HAVEGETDENTS) && defined(_HAVEGETDIRENTRIES) +static int +getdents(int fd, char *buf, int n) +{ + ssize_t nn; + off_t off; + + off = seek(fd, 0, 1); + nn = getdirentries(fd, buf, n, &off); + if(nn > 0) + seek(fd, off, 0); + return nn; +} +#endif + static int countde(char *p, int n) { |