]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getdirentries.3
fuse.4: fuse_entry_out: rework discussion of uniqueness of nodeid + generation
[thirdparty/man-pages.git] / man3 / getdirentries.3
CommitLineData
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 29getdirentries \- get directory entries in a filesystem-independent format
fea681da 30.SH SYNOPSIS
fea681da
MK
31.B #include <dirent.h>
32.sp
33.BI "ssize_t getdirentries(int " fd ", char *" buf ", size_t " nbytes
34.BI ", off_t *" basep );
cc4615cc
MK
35.sp
36.in -4n
37Feature Test Macro Requirements for glibc (see
38.BR feature_test_macros (7)):
39.in
40.sp
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
47Read directory entries from the directory specified by
48.I fd
49into
50.IR buf .
51At most
52.I nbytes
c13182ef
MK
53are read.
54Reading starts at offset
bd9b2a9c 55.IR *basep ,
fea681da 56and
bd9b2a9c 57.I *basep
fea681da 58is updated with the new position after reading.
47297adb 59.SH RETURN VALUE
e511ffb6 60.BR getdirentries ()
fea681da
MK
61returns the number of bytes read or zero when at the end of the directory.
62If an error occurs, \-1 is returned, and
63.I errno
64is set appropriately.
65.SH ERRORS
66See the Linux library source code for details.
6a404085 67.SH ATTRIBUTES
8b01d0ee
MK
68For an explanation of the terms used in this section, see
69.BR attributes (7).
70.TS
71allbox;
72lb lb lb
73l l l.
74Interface Attribute Value
75T{
6a404085 76.BR getdirentries ()
8b01d0ee
MK
77T} Thread safety MT-Safe
78.TE
47297adb 79.SH CONFORMING TO
3b89d4bf 80Not in POSIX.1.
c13182ef 81Present on the BSDs, and a few other systems.
a7fadb55
MK
82Use
83.BR opendir (3)
c13182ef 84and
a7fadb55
MK
85.BR readdir (3)
86instead.
47297adb 87.SH SEE ALSO
fea681da 88.BR lseek (2),
cc4615cc 89.BR open (2)