MentOS  0.8.0
The Mentoring Operating System
Functions
readdir.c File Reference

Function for accessing directory entries. More...

Functions

ssize_t sys_getdents (int fd, dirent_t *dirp, unsigned int count)
 

Detailed Description

Function for accessing directory entries.

Function Documentation

◆ sys_getdents()

ssize_t sys_getdents ( int  fd,
dirent_t dirp,
unsigned int  count 
)

Provide access to the directory entries.

Parameters
fdThe file descriptor of the directory for which we accessing the entries.
dirpThe buffer where de data should be placed.
countThe size of the buffer.
Returns
On success, the number of bytes read is returned. On end of directory, 0 is returned. On error, -1 is returned, and errno is set appropriately.