3 #include <sys/dirent.h>
10 DIR *opendir(const char *path
)
19 file
= handle_to_file(rv
);
21 if (file
->inode
->mode
!= DT_DIR
) {
30 * Read one directory entry at one time.
32 struct dirent
*readdir(DIR *dir
)
34 static struct dirent buf
;
35 struct file
*dd_dir
= (struct file
*)dir
;
39 if (dd_dir
->fs
->fs_ops
->readdir
) {
40 rv
= dd_dir
->fs
->fs_ops
->readdir(dd_dir
, &buf
);
44 return rv
< 0 ? NULL
: &buf
;
50 int closedir(DIR *dir
)
52 struct file
*dd_dir
= (struct file
*)dir
;