1GETDIRENTRIES(3)           Linux Programmer's Manual          GETDIRENTRIES(3)
2
3
4

NAME

6       getdirentries  - get directory entries in a filesystem-independent for‐
7       mat
8

SYNOPSIS

10       #include <dirent.h>
11
12       ssize_t getdirentries(int fd, char *restrict buf, size_t nbytes,
13                             off_t *restrict basep);
14
15   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17       getdirentries():
18           Since glibc 2.19:
19               _DEFAULT_SOURCE
20           Glibc 2.19 and earlier:
21               _BSD_SOURCE || _SVID_SOURCE
22

DESCRIPTION

24       Read directory entries from the directory specified by fd into buf.  At
25       most  nbytes  are read.  Reading starts at offset *basep, and *basep is
26       updated with the new position after reading.
27

RETURN VALUE

29       getdirentries() returns the number of bytes read or zero  when  at  the
30       end of the directory.  If an error occurs, -1 is returned, and errno is
31       set to indicate the error.
32

ERRORS

34       See the Linux library source code for details.
35

ATTRIBUTES

37       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
38       tributes(7).
39
40       ┌────────────────────────────────────────────┬───────────────┬─────────┐
41Interface                                   Attribute     Value   
42       ├────────────────────────────────────────────┼───────────────┼─────────┤
43getdirentries()                             │ Thread safety │ MT-Safe │
44       └────────────────────────────────────────────┴───────────────┴─────────┘
45

CONFORMING TO

47       Not  in  POSIX.1.   Present  on the BSDs, and a few other systems.  Use
48       opendir(3) and readdir(3) instead.
49

SEE ALSO

51       lseek(2), open(2)
52

COLOPHON

54       This page is part of release 5.12 of the Linux  man-pages  project.   A
55       description  of  the project, information about reporting bugs, and the
56       latest    version    of    this    page,    can     be     found     at
57       https://www.kernel.org/doc/man-pages/.
58
59
60
61GNU                               2021-03-22                  GETDIRENTRIES(3)
Impressum