Go to the previous, next section.

readdir

SYNOPSIS

struct dirent *readdir(DIR *dir);

PARAMETERS

dir: [in] the file descriptor of a directory.

DESCRIPTION

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???)

RETURN VALUE

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.