1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\" Portions extracted from /usr/include/dirent.h are:
3 .\" Copyright 1991, 1992 Free Software Foundation
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .TH GETDIRENTRIES 3 2021-03-22 "GNU" "Linux Programmer's Manual"
29 getdirentries \- get directory entries in a filesystem-independent format
32 .B #include <dirent.h>
34 .BI "ssize_t getdirentries(int " fd ", char *restrict " buf ", size_t " nbytes ,
35 .BI " off_t *restrict " basep );
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
47 Glibc 2.19 and earlier:
48 _BSD_SOURCE || _SVID_SOURCE
51 Read directory entries from the directory specified by
58 Reading starts at offset
62 is updated with the new position after reading.
65 returns the number of bytes read or zero when at the end of the directory.
66 If an error occurs, \-1 is returned, and
68 is set to indicate the error.
70 See the Linux library source code for details.
72 For an explanation of the terms used in this section, see
80 Interface Attribute Value
83 T} Thread safety MT-Safe
90 Present on the BSDs, and a few other systems.