—
NAME
getdirentries - get directory entries in a filesystem-independent format
LIBRARY
Standard C library (libc, -lc)
SYNOPSIS
bash
#include <dirent.h>bash
ssize_t getdirentries(int \nfd\n, char \nbuf\n[restrict .\nnbytes\n], size_t \nnbytes\n,\n
\n off_t *restrict \nbasep\n);getdirentries():
bash
\n
Since glibc 2.19:
\n
_DEFAULT_SOURCE
\n
glibc 2.19 and earlier:
\n
_BSD_SOURCE || _SVID_SOURCEDESCRIPTION
Read directory entries from the directory specified by fd into buf. At most nbytes are read. Reading starts at offset *basep, and *basep is updated with the new position after reading.
RETURN VALUE
getdirentries() returns the number of bytes read or zero when at the end of the directory. If an error occurs, -1 is returned, and errno is set to indicate the error.
ERRORS
See the Linux library source code for details.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| getdirentries () | Thread safety | MT-Safe |
STANDARDS
BSD.
NOTES
Use opendir(3) and readdir(3) instead.
SEE ALSO
lseek(2), open(2)