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