]>
Commit | Line | Data |
---|---|---|
fea681da MK |
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 | |
4 | .\" | |
93015253 | 5 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
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. | |
9 | .\" | |
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. | |
c13182ef | 14 | .\" |
fea681da MK |
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 | |
21 | .\" professionally. | |
c13182ef | 22 | .\" |
fea681da MK |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 25 | .\" %%%LICENSE_END |
fea681da | 26 | .\" |
97986708 | 27 | .TH GETDIRENTRIES 3 2016-03-15 "GNU" "Linux Programmer's Manual" |
fea681da | 28 | .SH NAME |
9ee4a2b6 | 29 | getdirentries \- get directory entries in a filesystem-independent format |
fea681da | 30 | .SH SYNOPSIS |
fea681da | 31 | .B #include <dirent.h> |
68e4db0a | 32 | .PP |
fea681da MK |
33 | .BI "ssize_t getdirentries(int " fd ", char *" buf ", size_t " nbytes |
34 | .BI ", off_t *" basep ); | |
68e4db0a | 35 | .PP |
cc4615cc MK |
36 | .in -4n |
37 | Feature Test Macro Requirements for glibc (see | |
38 | .BR feature_test_macros (7)): | |
39 | .in | |
68e4db0a | 40 | .PP |
cc4615cc | 41 | .BR getdirentries (): |
51c612fb MK |
42 | Since glibc 2.19: |
43 | _DEFAULT_SOURCE | |
44 | Glibc 2.19 and earlier: | |
45 | _BSD_SOURCE || _SVID_SOURCE | |
fea681da MK |
46 | .SH DESCRIPTION |
47 | Read directory entries from the directory specified by | |
48 | .I fd | |
49 | into | |
50 | .IR buf . | |
51 | At most | |
52 | .I nbytes | |
c13182ef MK |
53 | are read. |
54 | Reading starts at offset | |
bd9b2a9c | 55 | .IR *basep , |
fea681da | 56 | and |
bd9b2a9c | 57 | .I *basep |
fea681da | 58 | is updated with the new position after reading. |
47297adb | 59 | .SH RETURN VALUE |
e511ffb6 | 60 | .BR getdirentries () |
fea681da MK |
61 | returns the number of bytes read or zero when at the end of the directory. |
62 | If an error occurs, \-1 is returned, and | |
63 | .I errno | |
64 | is set appropriately. | |
65 | .SH ERRORS | |
66 | See the Linux library source code for details. | |
6a404085 | 67 | .SH ATTRIBUTES |
8b01d0ee MK |
68 | For an explanation of the terms used in this section, see |
69 | .BR attributes (7). | |
70 | .TS | |
71 | allbox; | |
72 | lb lb lb | |
73 | l l l. | |
74 | Interface Attribute Value | |
75 | T{ | |
6a404085 | 76 | .BR getdirentries () |
8b01d0ee MK |
77 | T} Thread safety MT-Safe |
78 | .TE | |
47297adb | 79 | .SH CONFORMING TO |
3b89d4bf | 80 | Not in POSIX.1. |
c13182ef | 81 | Present on the BSDs, and a few other systems. |
a7fadb55 MK |
82 | Use |
83 | .BR opendir (3) | |
c13182ef | 84 | and |
a7fadb55 MK |
85 | .BR readdir (3) |
86 | instead. | |
47297adb | 87 | .SH SEE ALSO |
fea681da | 88 | .BR lseek (2), |
cc4615cc | 89 | .BR open (2) |