system calls read directory entries from the directory
referenced by the file descriptor
into the buffer pointed to by
in a file system independent format.
of data will be transferred.
argument must be greater than or equal to the
block size associated with the file,
Some file systems may not support these system calls
with buffers smaller than this size.
The data in the buffer is a series of
structures each containing the following entries:
char d_name[MAXNAMELEN + 1]; /* see below */
entry is a number which is unique for each
distinct file in the file system.
Files that are linked by hard links (see
have the same
entry is the length, in bytes, of the directory record.
entry is the type of the file pointed to by the directory record.
The file type values are defined in
entry contains a null terminated file name.
entry specifies the length of the file name excluding the null byte.
Thus the actual size of
may vary from 1 to
Entries may be separated by extra space.
entry may be used as an offset from the start of a
structure to the next structure, if any.
The actual number of bytes transferred is returned.
The current position pointer associated with
is set to point to the next block of entries.
The pointer may not advance by the number of bytes returned by
A value of zero is returned when
the end of the directory has been reached.
system call writes the position of the block read into the location pointed to by
Alternatively, the current position pointer may be set and retrieved by
The current position pointer should only be set to a value returned by
a value returned in the location pointed to by