1GETDIRENTRIES(3) Linux Programmer's Manual GETDIRENTRIES(3)
2
3
4
6 getdirentries - get directory entries in a filesystem-independent for‐
7 mat
8
10 #include <dirent.h>
11
12 ssize_t getdirentries(int fd, char *buf, size_t nbytes , off_t *basep);
13
14 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
15
16 getdirentries():
17 Since glibc 2.19:
18 _DEFAULT_SOURCE
19 Glibc 2.19 and earlier:
20 _BSD_SOURCE || _SVID_SOURCE
21
23 Read directory entries from the directory specified by fd into buf. At
24 most nbytes are read. Reading starts at offset *basep, and *basep is
25 updated with the new position after reading.
26
28 getdirentries() returns the number of bytes read or zero when at the
29 end of the directory. If an error occurs, -1 is returned, and errno is
30 set appropriately.
31
33 See the Linux library source code for details.
34
36 For an explanation of the terms used in this section, see
37 attributes(7).
38
39 ┌────────────────┬───────────────┬─────────┐
40 │Interface │ Attribute │ Value │
41 ├────────────────┼───────────────┼─────────┤
42 │getdirentries() │ Thread safety │ MT-Safe │
43 └────────────────┴───────────────┴─────────┘
45 Not in POSIX.1. Present on the BSDs, and a few other systems. Use
46 opendir(3) and readdir(3) instead.
47
49 lseek(2), open(2)
50
52 This page is part of release 5.07 of the Linux man-pages project. A
53 description of the project, information about reporting bugs, and the
54 latest version of this page, can be found at
55 https://www.kernel.org/doc/man-pages/.
56
57
58
59GNU 2016-03-15 GETDIRENTRIES(3)