Go to the previous, next section.
struct dirent *readdir(DIR *dir);
dir: [in] the file descriptor of a directory.
This call returns in a dirent
structure the next entry of a
directory or NULL
if the end is reached or an error occurs. The
area where the pointer returned by readdir points to is a static space
that is overwritten by subsequent calls to readdir.
(It there no way to implement that call in user space???)
On success, returns a pointer to the dirent
structure. On error,
returns -1 and sets errno
to the following value: EBADF
.
Go to the previous, next section.