3 #include <sys/dirent.h>
10 DIR *opendir(const char *path
)
18 /* XXX: check for a directory handle here */
19 return (DIR *)handle_to_file(rv
);
23 * Read one directory entry at one time.
25 struct dirent
*readdir(DIR *dir
)
27 static struct dirent buf
;
28 struct file
*dd_dir
= (struct file
*)dir
;
32 if (dd_dir
->fs
->fs_ops
->readdir
) {
33 rv
= dd_dir
->fs
->fs_ops
->readdir(dd_dir
, &buf
);
37 return rv
< 0 ? NULL
: &buf
;
43 int closedir(DIR *dir
)
45 struct file
*dd_dir
= (struct file
*)dir
;