1getdirentries(3) Library Functions Manual getdirentries(3)
2
3
4
6 getdirentries - get directory entries in a filesystem-independent for‐
7 mat
8
10 Standard C library (libc, -lc)
11
13 #include <dirent.h>
14
15 ssize_t getdirentries(int fd, char buf[restrict .nbytes], size_t nbytes,
16 off_t *restrict basep);
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 getdirentries():
21 Since glibc 2.19:
22 _DEFAULT_SOURCE
23 glibc 2.19 and earlier:
24 _BSD_SOURCE || _SVID_SOURCE
25
27 Read directory entries from the directory specified by fd into buf. At
28 most nbytes are read. Reading starts at offset *basep, and *basep is
29 updated with the new position after reading.
30
32 getdirentries() returns the number of bytes read or zero when at the
33 end of the directory. If an error occurs, -1 is returned, and errno is
34 set to indicate the error.
35
37 See the Linux library source code for details.
38
40 For an explanation of the terms used in this section, see at‐
41 tributes(7).
42
43 ┌────────────────────────────────────────────┬───────────────┬─────────┐
44 │Interface │ Attribute │ Value │
45 ├────────────────────────────────────────────┼───────────────┼─────────┤
46 │getdirentries() │ Thread safety │ MT-Safe │
47 └────────────────────────────────────────────┴───────────────┴─────────┘
48
50 BSD.
51
53 Use opendir(3) and readdir(3) instead.
54
56 lseek(2), open(2)
57
58
59
60Linux man-pages 6.05 2023-07-20 getdirentries(3)