#include <oskit/fs/dir.h>oskit_error_t oskit_dir_getdirentries(oskit_dir_t *d, oskit_u32_t *inout_ofs, oskit_u32_t nentries, [out] oskit_dirents_t *out_dirents);
client OS filesystem library
This method reads one or more entries from this directory. On entry, inout_ofs contains the offset of the first entry to be read. Before returning, this method updates the value at inout_ofs to contain the offset of the next entry after the last entry returned in out_dirents. The returned value of inout_ofs is opaque; it should only be used in subsequent calls to this method.This method will return at least nentries entries if there are at least that many entries remaining in the directory; however, this method may return more entries.
The client operating system must free the contents of out_dirents when they are no longer needed.
out_dirents is a pointer to an oskit_dirents_t structure defined as follows:
char *name; /* entry name */ oskit_ino_t ino; /* entry inode */};
struct oskit_dirent *dirents; /* array of entries */ oskit_u32_t count; /* number of entries */};
- d
- The directory to read.
- inout_ofs
- On entry, the offset of the first entry to read. On exit, the offset of the next entry to read.
- nentries
- The minimum desired number of entries.
- out_dirents
- The directory entries.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.