OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / 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 .\" %%%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.
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.
14 .\"
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.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .TH GETDIRENTRIES 3 2014-06-13 "GNU" "Linux Programmer's Manual"
28 .SH NAME
29 getdirentries \- get directory entries in a filesystem-independent format
30 .SH SYNOPSIS
31 .B #include <dirent.h>
32 .sp
33 .BI "ssize_t getdirentries(int " fd ", char *" buf ", size_t " nbytes
34 .BI ", off_t *" basep );
35 .sp
36 .in -4n
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
39 .in
40 .sp
41 .BR getdirentries ():
42 _BSD_SOURCE || _SVID_SOURCE
43 .SH DESCRIPTION
44 Read directory entries from the directory specified by
45 .I fd
46 into
47 .IR buf .
48 At most
49 .I nbytes
50 are read.
51 Reading starts at offset
52 .IR *basep ,
53 and
54 .I *basep
55 is updated with the new position after reading.
56 .SH RETURN VALUE
57 .BR getdirentries ()
58 returns the number of bytes read or zero when at the end of the directory.
59 If an error occurs, \-1 is returned, and
60 .I errno
61 is set appropriately.
62 .SH ERRORS
63 See the Linux library source code for details.
64 .SH ATTRIBUTES
65 .SS Multithreading (see pthreads(7))
66 The
67 .BR getdirentries ()
68 function is thread-safe.
69 .SH CONFORMING TO
70 Not in POSIX.1-2001.
71 Present on the BSDs, and a few other systems.
72 Use
73 .BR opendir (3)
74 and
75 .BR readdir (3)
76 instead.
77 .SH SEE ALSO
78 .BR lseek (2),
79 .BR open (2)
80 .SH COLOPHON
81 This page is part of release 3.79 of the Linux
82 .I man-pages
83 project.
84 A description of the project,
85 information about reporting bugs,
86 and the latest version of this page,
87 can be found at
88 \%http://www.kernel.org/doc/man\-pages/.