next up previous contents index
Next: 7.5.9 mknod: Create a Up: 7.5 oskit_dir: Directory Interface Previous: 7.5.7 rmdir: Remove a

7.5.8 getdirentries: Read one or more entries from this directory

 

SYNOPSIS

#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);

DIRECTION

client OS tex2html_wrap_inline32841 filesystem library

DESCRIPTION

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:

struct oskit_dirent  {

		char *name;			/* entry name */
		oskit_ino_t ino;		/* entry inode */
	 
};

struct oskit_dirents  {

		struct oskit_dirent *dirents;	/* array of entries */
		oskit_u32_t count;		/* number of entries */
	 
};

PARAMETERS

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

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group