5 int __getdents(int, struct dirent *, size_t);
7 struct dirent *readdir(DIR *dir)
11 if (dir->buf_pos >= dir->buf_end) {
12 int len = __getdents(dir->fd, (void *)dir->buf, sizeof dir->buf);
13 if (len <= 0) return 0;
17 de = (void *)(dir->buf + dir->buf_pos);
18 dir->buf_pos += de->d_reclen;
19 dir->tell = de->d_off;