]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getdirentries.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / getdirentries.3
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 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH getdirentries 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 getdirentries \- get directory entries in a filesystem-independent format
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <dirent.h>
16 .PP
17 .BI "ssize_t getdirentries(int " fd ", char *restrict " buf ", size_t " nbytes ,
18 .BI " off_t *restrict " basep );
19 .fi
20 .PP
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .PP
26 .BR getdirentries ():
27 .nf
28 Since glibc 2.19:
29 _DEFAULT_SOURCE
30 Glibc 2.19 and earlier:
31 _BSD_SOURCE || _SVID_SOURCE
32 .fi
33 .SH DESCRIPTION
34 Read directory entries from the directory specified by
35 .I fd
36 into
37 .IR buf .
38 At most
39 .I nbytes
40 are read.
41 Reading starts at offset
42 .IR *basep ,
43 and
44 .I *basep
45 is updated with the new position after reading.
46 .SH RETURN VALUE
47 .BR getdirentries ()
48 returns the number of bytes read or zero when at the end of the directory.
49 If an error occurs, \-1 is returned, and
50 .I errno
51 is set to indicate the error.
52 .SH ERRORS
53 See the Linux library source code for details.
54 .SH ATTRIBUTES
55 For an explanation of the terms used in this section, see
56 .BR attributes (7).
57 .ad l
58 .nh
59 .TS
60 allbox;
61 lbx lb lb
62 l l l.
63 Interface Attribute Value
64 T{
65 .BR getdirentries ()
66 T} Thread safety MT-Safe
67 .TE
68 .hy
69 .ad
70 .sp 1
71 .SH STANDARDS
72 Not in POSIX.1.
73 Present on the BSDs, and a few other systems.
74 Use
75 .BR opendir (3)
76 and
77 .BR readdir (3)
78 instead.
79 .SH SEE ALSO
80 .BR lseek (2),
81 .BR open (2)