OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.40.
[linuxjm/LDP_man-pages.git] / po4a / dirent / po / dirent.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-05-01 04:38+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man3/closedir.3:29
21 #, no-wrap
22 msgid "CLOSEDIR"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/closedir.3:29
27 #, no-wrap
28 msgid "2008-09-23"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/closedir.3:29 build/C/man3/dirfd.3:23 build/C/man2/getdents.2:27 build/C/man3/getdirentries.3:27 build/C/man3/opendir.3:30 build/C/man2/readdir.2:28 build/C/man3/readdir.3:34 build/C/man3/rewinddir.3:29 build/C/man3/scandir.3:34 build/C/man3/scandirat.3:26 build/C/man3/seekdir.3:28 build/C/man3/telldir.3:28
33 #, no-wrap
34 msgid "Linux Programmer's Manual"
35 msgstr ""
36
37 #. type: SH
38 #: build/C/man3/closedir.3:30 build/C/man3/dirfd.3:24 build/C/man2/getdents.2:28 build/C/man3/getdirentries.3:28 build/C/man3/opendir.3:31 build/C/man2/readdir.2:29 build/C/man3/readdir.3:35 build/C/man3/rewinddir.3:30 build/C/man3/scandir.3:35 build/C/man3/scandirat.3:27 build/C/man3/seekdir.3:29 build/C/man3/telldir.3:29
39 #, no-wrap
40 msgid "NAME"
41 msgstr ""
42
43 #. type: Plain text
44 #: build/C/man3/closedir.3:32
45 msgid "closedir - close a directory"
46 msgstr ""
47
48 #. type: SH
49 #: build/C/man3/closedir.3:32 build/C/man3/dirfd.3:26 build/C/man2/getdents.2:30 build/C/man3/getdirentries.3:30 build/C/man3/opendir.3:33 build/C/man2/readdir.2:31 build/C/man3/readdir.3:37 build/C/man3/rewinddir.3:32 build/C/man3/scandir.3:37 build/C/man3/scandirat.3:29 build/C/man3/seekdir.3:32 build/C/man3/telldir.3:31
50 #, no-wrap
51 msgid "SYNOPSIS"
52 msgstr ""
53
54 #. type: Plain text
55 #: build/C/man3/closedir.3:35 build/C/man3/opendir.3:36 build/C/man3/rewinddir.3:35
56 #, no-wrap
57 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man3/closedir.3:37 build/C/man3/opendir.3:38 build/C/man3/readdir.3:40 build/C/man3/rewinddir.3:37 build/C/man3/scandir.3:40 build/C/man3/seekdir.3:35 build/C/man3/telldir.3:34
62 #, no-wrap
63 msgid "B<#include E<lt>dirent.hE<gt>>\n"
64 msgstr ""
65
66 #. type: Plain text
67 #: build/C/man3/closedir.3:39
68 #, no-wrap
69 msgid "B<int closedir(DIR *>I<dirp>B<);>\n"
70 msgstr ""
71
72 #. type: SH
73 #: build/C/man3/closedir.3:40 build/C/man3/dirfd.3:52 build/C/man2/getdents.2:35 build/C/man3/getdirentries.3:43 build/C/man3/opendir.3:61 build/C/man2/readdir.2:37 build/C/man3/readdir.3:59 build/C/man3/rewinddir.3:40 build/C/man3/scandir.3:63 build/C/man3/scandirat.3:45 build/C/man3/seekdir.3:46 build/C/man3/telldir.3:45
74 #, no-wrap
75 msgid "DESCRIPTION"
76 msgstr ""
77
78 #. type: Plain text
79 #: build/C/man3/closedir.3:51
80 msgid ""
81 "The B<closedir>()  function closes the directory stream associated with "
82 "I<dirp>.  A successful call to B<closedir>()  also closes the underlying "
83 "file descriptor associated with I<dirp>.  The directory stream descriptor "
84 "I<dirp> is not available after this call."
85 msgstr ""
86
87 #. type: SH
88 #: build/C/man3/closedir.3:51 build/C/man3/dirfd.3:67 build/C/man2/getdents.2:136 build/C/man3/getdirentries.3:56 build/C/man3/opendir.3:81 build/C/man2/readdir.2:86 build/C/man3/readdir.3:117 build/C/man3/rewinddir.3:45 build/C/man3/scandir.3:90 build/C/man3/scandirat.3:79 build/C/man3/seekdir.3:58 build/C/man3/telldir.3:50
89 #, no-wrap
90 msgid "RETURN VALUE"
91 msgstr ""
92
93 #. type: Plain text
94 #: build/C/man3/closedir.3:58
95 msgid ""
96 "The B<closedir>()  function returns 0 on success.  On error, -1 is returned, "
97 "and I<errno> is set appropriately."
98 msgstr ""
99
100 #. type: SH
101 #: build/C/man3/closedir.3:58 build/C/man3/dirfd.3:70 build/C/man2/getdents.2:142 build/C/man3/getdirentries.3:62 build/C/man3/opendir.3:90 build/C/man2/readdir.2:92 build/C/man3/readdir.3:141 build/C/man3/scandir.3:103 build/C/man3/scandirat.3:86 build/C/man3/telldir.3:58
102 #, no-wrap
103 msgid "ERRORS"
104 msgstr ""
105
106 #. type: TP
107 #: build/C/man3/closedir.3:59 build/C/man2/getdents.2:143 build/C/man3/opendir.3:94 build/C/man2/readdir.2:93 build/C/man3/readdir.3:142 build/C/man3/scandirat.3:93 build/C/man3/telldir.3:59
108 #, no-wrap
109 msgid "B<EBADF>"
110 msgstr ""
111
112 #. type: Plain text
113 #: build/C/man3/closedir.3:62 build/C/man3/readdir.3:145 build/C/man3/telldir.3:62
114 msgid "Invalid directory stream descriptor I<dirp>."
115 msgstr ""
116
117 #. type: SH
118 #: build/C/man3/closedir.3:62 build/C/man3/dirfd.3:83 build/C/man2/getdents.2:159 build/C/man3/getdirentries.3:64 build/C/man3/opendir.3:116 build/C/man2/readdir.2:109 build/C/man3/readdir.3:145 build/C/man3/rewinddir.3:49 build/C/man3/scandir.3:116 build/C/man3/scandirat.3:106 build/C/man3/seekdir.3:62 build/C/man3/telldir.3:62
119 #, no-wrap
120 msgid "CONFORMING TO"
121 msgstr ""
122
123 #. type: Plain text
124 #: build/C/man3/closedir.3:64
125 msgid "SVr4, POSIX.1-2001, 4.3BSD."
126 msgstr ""
127
128 #. type: SH
129 #: build/C/man3/closedir.3:64 build/C/man3/dirfd.3:95 build/C/man2/getdents.2:273 build/C/man3/getdirentries.3:72 build/C/man3/opendir.3:138 build/C/man2/readdir.2:117 build/C/man3/readdir.3:239 build/C/man3/rewinddir.3:51 build/C/man3/scandir.3:172 build/C/man3/scandirat.3:113 build/C/man3/seekdir.3:72 build/C/man3/telldir.3:72
130 #, no-wrap
131 msgid "SEE ALSO"
132 msgstr ""
133
134 #. type: Plain text
135 #: build/C/man3/closedir.3:72
136 msgid ""
137 "B<close>(2), B<opendir>(3), B<readdir>(3), B<rewinddir>(3), B<scandir>(3), "
138 "B<seekdir>(3), B<telldir>(3)"
139 msgstr ""
140
141 #. type: SH
142 #: build/C/man3/closedir.3:72 build/C/man3/dirfd.3:104 build/C/man2/getdents.2:276 build/C/man3/getdirentries.3:75 build/C/man3/opendir.3:147 build/C/man2/readdir.2:120 build/C/man3/readdir.3:251 build/C/man3/rewinddir.3:58 build/C/man3/scandir.3:184 build/C/man3/scandirat.3:117 build/C/man3/seekdir.3:80 build/C/man3/telldir.3:79
143 #, no-wrap
144 msgid "COLOPHON"
145 msgstr ""
146
147 #. type: Plain text
148 #: build/C/man3/closedir.3:79 build/C/man3/dirfd.3:111 build/C/man2/getdents.2:283 build/C/man3/getdirentries.3:82 build/C/man3/opendir.3:154 build/C/man2/readdir.2:127 build/C/man3/readdir.3:258 build/C/man3/rewinddir.3:65 build/C/man3/scandir.3:191 build/C/man3/scandirat.3:124 build/C/man3/seekdir.3:87 build/C/man3/telldir.3:86
149 msgid ""
150 "This page is part of release 3.40 of the Linux I<man-pages> project.  A "
151 "description of the project, and information about reporting bugs, can be "
152 "found at http://www.kernel.org/doc/man-pages/."
153 msgstr ""
154
155 #. type: TH
156 #: build/C/man3/dirfd.3:23
157 #, no-wrap
158 msgid "DIRFD"
159 msgstr ""
160
161 #. type: TH
162 #: build/C/man3/dirfd.3:23
163 #, no-wrap
164 msgid "2010-09-26"
165 msgstr ""
166
167 #. type: TH
168 #: build/C/man3/dirfd.3:23 build/C/man2/getdents.2:27 build/C/man2/readdir.2:28 build/C/man3/scandirat.3:26
169 #, no-wrap
170 msgid "Linux"
171 msgstr ""
172
173 #. type: Plain text
174 #: build/C/man3/dirfd.3:26
175 msgid "dirfd - get directory stream file descriptor"
176 msgstr ""
177
178 #. type: Plain text
179 #: build/C/man3/dirfd.3:28
180 msgid "B<#include E<lt>sys/types.hE<gt>>"
181 msgstr ""
182
183 #. type: Plain text
184 #: build/C/man3/dirfd.3:30 build/C/man3/getdirentries.3:32
185 msgid "B<#include E<lt>dirent.hE<gt>>"
186 msgstr ""
187
188 #. type: Plain text
189 #: build/C/man3/dirfd.3:32
190 msgid "B<int dirfd(DIR *>I<dirp>B<);>"
191 msgstr ""
192
193 #. type: Plain text
194 #: build/C/man3/dirfd.3:36 build/C/man3/getdirentries.3:39 build/C/man3/opendir.3:46 build/C/man3/readdir.3:50 build/C/man3/scandir.3:55 build/C/man3/seekdir.3:42 build/C/man3/telldir.3:41
195 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
196 msgstr ""
197
198 #. type: Plain text
199 #: build/C/man3/dirfd.3:39
200 msgid "B<dirfd>():"
201 msgstr ""
202
203 #. type: Plain text
204 #: build/C/man3/dirfd.3:44
205 msgid "_BSD_SOURCE || _SVID_SOURCE"
206 msgstr ""
207
208 #. type: Plain text
209 #: build/C/man3/dirfd.3:46
210 msgid "|| /* Since glibc 2.10: */"
211 msgstr ""
212
213 #. type: Plain text
214 #: build/C/man3/dirfd.3:48
215 msgid "(_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700)"
216 msgstr ""
217
218 #. type: Plain text
219 #: build/C/man3/dirfd.3:57
220 msgid ""
221 "The function B<dirfd>()  returns the file descriptor associated with the "
222 "directory stream I<dirp>."
223 msgstr ""
224
225 #. type: Plain text
226 #: build/C/man3/dirfd.3:67
227 msgid ""
228 "This descriptor is the one used internally by the directory stream.  As a "
229 "result, it is only useful for functions which do not depend on or alter the "
230 "file position, such as B<fstat>(2)  and B<fchdir>(2).  It will be "
231 "automatically closed when B<closedir>(3)  is called."
232 msgstr ""
233
234 #. type: Plain text
235 #: build/C/man3/dirfd.3:70
236 msgid ""
237 "On success, a nonnegative file descriptor is returned.  On error, -1 is "
238 "returned."
239 msgstr ""
240
241 #.  glibc 2.8
242 #. type: Plain text
243 #: build/C/man3/dirfd.3:75
244 msgid ""
245 "POSIX.1-2008 specifies two errors, neither of which is returned by the "
246 "current implementation."
247 msgstr ""
248
249 #. type: TP
250 #: build/C/man3/dirfd.3:75 build/C/man2/getdents.2:150 build/C/man2/readdir.2:100
251 #, no-wrap
252 msgid "B<EINVAL>"
253 msgstr ""
254
255 #. type: Plain text
256 #: build/C/man3/dirfd.3:79
257 msgid "I<dirp> does not refer to a valid directory stream."
258 msgstr ""
259
260 #. type: TP
261 #: build/C/man3/dirfd.3:79
262 #, no-wrap
263 msgid "B<ENOTSUP>"
264 msgstr ""
265
266 #. type: Plain text
267 #: build/C/man3/dirfd.3:83
268 msgid ""
269 "The implementation does not support the association of a file descriptor "
270 "with a directory."
271 msgstr ""
272
273 #.  It is present in libc5 (since 5.1.2) and in glibc2.
274 #. type: Plain text
275 #: build/C/man3/dirfd.3:87
276 msgid ""
277 "POSIX.1-2008.  This function was a BSD extension, present in 4.3BSD-Reno, "
278 "not in 4.2BSD."
279 msgstr ""
280
281 #. type: SH
282 #: build/C/man3/dirfd.3:87 build/C/man2/getdents.2:162 build/C/man3/opendir.3:121 build/C/man2/readdir.2:111 build/C/man3/readdir.3:147 build/C/man3/scandirat.3:108 build/C/man3/seekdir.3:64 build/C/man3/telldir.3:64
283 #, no-wrap
284 msgid "NOTES"
285 msgstr ""
286
287 #. type: Plain text
288 #: build/C/man3/dirfd.3:95
289 msgid ""
290 "The prototype for B<dirfd>()  is only available if B<_BSD_SOURCE> or "
291 "B<_SVID_SOURCE> is defined."
292 msgstr ""
293
294 #. type: Plain text
295 #: build/C/man3/dirfd.3:104
296 msgid ""
297 "B<open>(2), B<closedir>(3), B<opendir>(3), B<readdir>(3), B<rewinddir>(3), "
298 "B<scandir>(3), B<seekdir>(3), B<telldir>(3)"
299 msgstr ""
300
301 #. type: TH
302 #: build/C/man2/getdents.2:27
303 #, no-wrap
304 msgid "GETDENTS"
305 msgstr ""
306
307 #. type: TH
308 #: build/C/man2/getdents.2:27
309 #, no-wrap
310 msgid "2010-11-21"
311 msgstr ""
312
313 #. type: Plain text
314 #: build/C/man2/getdents.2:30
315 msgid "getdents - get directory entries"
316 msgstr ""
317
318 #. type: Plain text
319 #: build/C/man2/getdents.2:34
320 #, no-wrap
321 msgid ""
322 "B<int getdents(unsigned int >I<fd>B<, struct linux_dirent *>I<dirp>B<,>\n"
323 "B<             unsigned int >I<count>B<);>\n"
324 msgstr ""
325
326 #. type: Plain text
327 #: build/C/man2/getdents.2:41
328 msgid ""
329 "This is not the function you are interested in.  Look at B<readdir>(3)  for "
330 "the POSIX conforming C library interface.  This page documents the bare "
331 "kernel system call interface."
332 msgstr ""
333
334 #. type: Plain text
335 #: build/C/man2/getdents.2:54
336 msgid ""
337 "The system call B<getdents>()  reads several I<linux_dirent> structures from "
338 "the directory referred to by the open file descriptor I<fd> into the buffer "
339 "pointed to by I<dirp>.  The argument I<count> specifies the size of that "
340 "buffer."
341 msgstr ""
342
343 #. type: Plain text
344 #: build/C/man2/getdents.2:58
345 msgid "The I<linux_dirent> structure is declared as follows:"
346 msgstr ""
347
348 #. type: Plain text
349 #: build/C/man2/getdents.2:73
350 #, no-wrap
351 msgid ""
352 "struct linux_dirent {\n"
353 "    unsigned long  d_ino;     /* Inode number */\n"
354 "    unsigned long  d_off;     /* Offset to next I<linux_dirent> */\n"
355 "    unsigned short d_reclen;  /* Length of this I<linux_dirent> */\n"
356 "    char           d_name[];  /* Filename (null-terminated) */\n"
357 "                        /* length is actually (d_reclen - 2 -\n"
358 "                           offsetof(struct linux_dirent, d_name) */\n"
359 "    /*\n"
360 "    char           pad;       // Zero padding byte\n"
361 "    char           d_type;    // File type (only since Linux 2.6.4;\n"
362 "                              // offset is (d_reclen - 1))\n"
363 "    */\n"
364 msgstr ""
365
366 #. type: Plain text
367 #: build/C/man2/getdents.2:75
368 #, no-wrap
369 msgid "}\n"
370 msgstr ""
371
372 #. type: Plain text
373 #: build/C/man2/getdents.2:88
374 msgid ""
375 "I<d_ino> is an inode number.  I<d_off> is the distance from the start of the "
376 "directory to the start of the next I<linux_dirent>.  I<d_reclen> is the size "
377 "of this entire I<linux_dirent>.  I<d_name> is a null-terminated filename."
378 msgstr ""
379
380 #. type: Plain text
381 #: build/C/man2/getdents.2:93
382 msgid ""
383 "I<d_type> is a byte at the end of the structure that indicates the file "
384 "type.  It contains one of the following values (defined in "
385 "I<E<lt>dirent.hE<gt>>):"
386 msgstr ""
387
388 #. type: TP
389 #: build/C/man2/getdents.2:93 build/C/man3/readdir.3:176
390 #, no-wrap
391 msgid "B<DT_BLK>"
392 msgstr ""
393
394 #. type: Plain text
395 #: build/C/man2/getdents.2:96 build/C/man3/readdir.3:179
396 msgid "This is a block device."
397 msgstr ""
398
399 #. type: TP
400 #: build/C/man2/getdents.2:96 build/C/man3/readdir.3:179
401 #, no-wrap
402 msgid "B<DT_CHR>"
403 msgstr ""
404
405 #. type: Plain text
406 #: build/C/man2/getdents.2:99 build/C/man3/readdir.3:182
407 msgid "This is a character device."
408 msgstr ""
409
410 #. type: TP
411 #: build/C/man2/getdents.2:99 build/C/man3/readdir.3:182
412 #, no-wrap
413 msgid "B<DT_DIR>"
414 msgstr ""
415
416 #. type: Plain text
417 #: build/C/man2/getdents.2:102 build/C/man3/readdir.3:185
418 msgid "This is a directory."
419 msgstr ""
420
421 #. type: TP
422 #: build/C/man2/getdents.2:102 build/C/man3/readdir.3:185
423 #, no-wrap
424 msgid "B<DT_FIFO>"
425 msgstr ""
426
427 #. type: Plain text
428 #: build/C/man2/getdents.2:105 build/C/man3/readdir.3:188
429 msgid "This is a named pipe (FIFO)."
430 msgstr ""
431
432 #. type: TP
433 #: build/C/man2/getdents.2:105 build/C/man3/readdir.3:188
434 #, no-wrap
435 msgid "B<DT_LNK>"
436 msgstr ""
437
438 #. type: Plain text
439 #: build/C/man2/getdents.2:108 build/C/man3/readdir.3:191
440 msgid "This is a symbolic link."
441 msgstr ""
442
443 #. type: TP
444 #: build/C/man2/getdents.2:108 build/C/man3/readdir.3:191
445 #, no-wrap
446 msgid "B<DT_REG>"
447 msgstr ""
448
449 #. type: Plain text
450 #: build/C/man2/getdents.2:111 build/C/man3/readdir.3:194
451 msgid "This is a regular file."
452 msgstr ""
453
454 #. type: TP
455 #: build/C/man2/getdents.2:111 build/C/man3/readdir.3:194
456 #, no-wrap
457 msgid "B<DT_SOCK>"
458 msgstr ""
459
460 #. type: Plain text
461 #: build/C/man2/getdents.2:114 build/C/man3/readdir.3:197
462 msgid "This is a UNIX domain socket."
463 msgstr ""
464
465 #. type: TP
466 #: build/C/man2/getdents.2:114 build/C/man3/readdir.3:197
467 #, no-wrap
468 msgid "B<DT_UNKNOWN>"
469 msgstr ""
470
471 #.  The glibc manual says that on some systems this is the only
472 #.  value returned
473 #. type: Plain text
474 #: build/C/man2/getdents.2:117 build/C/man3/readdir.3:202
475 msgid "The file type is unknown."
476 msgstr ""
477
478 #. type: Plain text
479 #: build/C/man2/getdents.2:127
480 msgid ""
481 "The I<d_type> field is implemented since Linux 2.6.4.  It occupies a space "
482 "that was previously a zero-filled padding byte in the I<linux_dirent> "
483 "structure.  Thus, on kernels before 2.6.3, attempting to access this field "
484 "always provides the value 0 (B<DT_UNKNOWN>)."
485 msgstr ""
486
487 #.  kernel 2.6.27
488 #.  The same sentence is in getdents.2
489 #. type: Plain text
490 #: build/C/man2/getdents.2:136 build/C/man3/readdir.3:216
491 msgid ""
492 "Currently, only some file systems (among them: Btrfs, ext2, ext3, and ext4)  "
493 "have full support for returning the file type in I<d_type>.  All "
494 "applications must properly handle a return of B<DT_UNKNOWN>."
495 msgstr ""
496
497 #. type: Plain text
498 #: build/C/man2/getdents.2:142
499 msgid ""
500 "On success, the number of bytes read is returned.  On end of directory, 0 is "
501 "returned.  On error, -1 is returned, and I<errno> is set appropriately."
502 msgstr ""
503
504 #. type: Plain text
505 #: build/C/man2/getdents.2:147 build/C/man2/readdir.2:97
506 msgid "Invalid file descriptor I<fd>."
507 msgstr ""
508
509 #. type: TP
510 #: build/C/man2/getdents.2:147 build/C/man2/readdir.2:97
511 #, no-wrap
512 msgid "B<EFAULT>"
513 msgstr ""
514
515 #. type: Plain text
516 #: build/C/man2/getdents.2:150 build/C/man2/readdir.2:100
517 msgid "Argument points outside the calling process's address space."
518 msgstr ""
519
520 #. type: Plain text
521 #: build/C/man2/getdents.2:153 build/C/man2/readdir.2:103
522 msgid "Result buffer is too small."
523 msgstr ""
524
525 #. type: TP
526 #: build/C/man2/getdents.2:153 build/C/man3/opendir.3:104 build/C/man2/readdir.2:103 build/C/man3/scandir.3:104
527 #, no-wrap
528 msgid "B<ENOENT>"
529 msgstr ""
530
531 #. type: Plain text
532 #: build/C/man2/getdents.2:156 build/C/man2/readdir.2:106
533 msgid "No such directory."
534 msgstr ""
535
536 #. type: TP
537 #: build/C/man2/getdents.2:156 build/C/man3/opendir.3:110 build/C/man2/readdir.2:106 build/C/man3/scandir.3:110 build/C/man3/scandirat.3:97
538 #, no-wrap
539 msgid "B<ENOTDIR>"
540 msgstr ""
541
542 #. type: Plain text
543 #: build/C/man2/getdents.2:159 build/C/man2/readdir.2:109
544 msgid "File descriptor does not refer to a directory."
545 msgstr ""
546
547 #.  SVr4 documents additional ENOLINK, EIO error conditions.
548 #. type: Plain text
549 #: build/C/man2/getdents.2:162
550 msgid "SVr4."
551 msgstr ""
552
553 #. type: Plain text
554 #: build/C/man2/getdents.2:168
555 msgid ""
556 "Glibc does not provide a wrapper for this system call; call it using "
557 "B<syscall>(2).  You will need to define the I<linux_dirent> structure "
558 "yourself."
559 msgstr ""
560
561 #. type: Plain text
562 #: build/C/man2/getdents.2:171
563 msgid "This call supersedes B<readdir>(2)."
564 msgstr ""
565
566 #. type: Plain text
567 #: build/C/man2/getdents.2:184
568 msgid ""
569 "The original Linux B<getdents>()  system call did not handle large file "
570 "systems and large file offsets.  Consequently, Linux 2.4 added "
571 "B<getdents64>(), with wider types for the I<d_ino> and I<d_off> fields "
572 "employed in the I<linux_dirent> structure."
573 msgstr ""
574
575 #. type: SH
576 #: build/C/man2/getdents.2:184 build/C/man3/scandir.3:148
577 #, no-wrap
578 msgid "EXAMPLE"
579 msgstr ""
580
581 #.  FIXME: This program uses the older getdents(0 system call
582 #.  and the structure with smaller field widths.
583 #. type: Plain text
584 #: build/C/man2/getdents.2:191
585 msgid ""
586 "The program below demonstrates the use of B<getdents>().  The following "
587 "output shows an example of what we see when running this program on an ext2 "
588 "directory:"
589 msgstr ""
590
591 #. type: Plain text
592 #: build/C/man2/getdents.2:204
593 #, no-wrap
594 msgid ""
595 "$B< ./a.out /testfs/>\n"
596 "--------------- nread=120 ---------------\n"
597 "i-node#  file type  d_reclen  d_off   d_name\n"
598 "       2  directory    16         12  .\n"
599 "       2  directory    16         24  ..\n"
600 "      11  directory    24         44  lost+found\n"
601 "      12  regular      16         56  a\n"
602 "  228929  directory    16         68  sub\n"
603 "   16353  directory    16         80  sub2\n"
604 "  130817  directory    16       4096  sub3\n"
605 msgstr ""
606
607 #. type: SS
608 #: build/C/man2/getdents.2:206
609 #, no-wrap
610 msgid "Program source"
611 msgstr ""
612
613 #. type: Plain text
614 #: build/C/man2/getdents.2:217
615 #, no-wrap
616 msgid ""
617 "#define _GNU_SOURCE\n"
618 "#include E<lt>dirent.hE<gt>     /* Defines DT_* constants */\n"
619 "#include E<lt>fcntl.hE<gt>\n"
620 "#include E<lt>stdio.hE<gt>\n"
621 "#include E<lt>unistd.hE<gt>\n"
622 "#include E<lt>stdlib.hE<gt>\n"
623 "#include E<lt>sys/stat.hE<gt>\n"
624 "#include E<lt>sys/syscall.hE<gt>\n"
625 msgstr ""
626
627 #. type: Plain text
628 #: build/C/man2/getdents.2:220
629 #, no-wrap
630 msgid ""
631 "#define handle_error(msg) \\e\n"
632 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
633 msgstr ""
634
635 #. type: Plain text
636 #: build/C/man2/getdents.2:227
637 #, no-wrap
638 msgid ""
639 "struct linux_dirent {\n"
640 "    long           d_ino;\n"
641 "    off_t          d_off;\n"
642 "    unsigned short d_reclen;\n"
643 "    char           d_name[];\n"
644 "};\n"
645 msgstr ""
646
647 #. type: Plain text
648 #: build/C/man2/getdents.2:229
649 #, no-wrap
650 msgid "#define BUF_SIZE 1024\n"
651 msgstr ""
652
653 #. type: Plain text
654 #: build/C/man2/getdents.2:238
655 #, no-wrap
656 msgid ""
657 "int\n"
658 "main(int argc, char *argv[])\n"
659 "{\n"
660 "    int fd, nread;\n"
661 "    char buf[BUF_SIZE];\n"
662 "    struct linux_dirent *d;\n"
663 "    int bpos;\n"
664 "    char d_type;\n"
665 msgstr ""
666
667 #. type: Plain text
668 #: build/C/man2/getdents.2:242
669 #, no-wrap
670 msgid ""
671 "    fd = open(argc E<gt> 1 ? argv[1] : \".\", O_RDONLY | O_DIRECTORY);\n"
672 "    if (fd == -1)\n"
673 "        handle_error(\"open\");\n"
674 msgstr ""
675
676 #. type: Plain text
677 #: build/C/man2/getdents.2:247
678 #, no-wrap
679 msgid ""
680 "    for ( ; ; ) {\n"
681 "        nread = syscall(SYS_getdents, fd, buf, BUF_SIZE);\n"
682 "        if (nread == -1)\n"
683 "            handle_error(\"getdents\");\n"
684 msgstr ""
685
686 #. type: Plain text
687 #: build/C/man2/getdents.2:250
688 #, no-wrap
689 msgid ""
690 "        if (nread == 0)\n"
691 "            break;\n"
692 msgstr ""
693
694 #. type: Plain text
695 #: build/C/man2/getdents.2:269
696 #, no-wrap
697 msgid ""
698 "        printf(\"--------------- nread=%d ---------------\\en\", nread);\n"
699 "        printf(\"i-node#  file type  d_reclen  d_off   d_name\\en\");\n"
700 "        for (bpos = 0; bpos E<lt> nread;) {\n"
701 "            d = (struct linux_dirent *) (buf + bpos);\n"
702 "            printf(\"%8ld  \", d-E<gt>d_ino);\n"
703 "            d_type = *(buf + bpos + d-E<gt>d_reclen - 1);\n"
704 "            printf(\"%-10s \", (d_type == DT_REG) ?  \"regular\" :\n"
705 "                             (d_type == DT_DIR) ?  \"directory\" :\n"
706 "                             (d_type == DT_FIFO) ? \"FIFO\" :\n"
707 "                             (d_type == DT_SOCK) ? \"socket\" :\n"
708 "                             (d_type == DT_LNK) ?  \"symlink\" :\n"
709 "                             (d_type == DT_BLK) ?  \"block dev\" :\n"
710 "                             (d_type == DT_CHR) ?  \"char dev\" : "
711 "\"???\");\n"
712 "            printf(\"%4d %10lld  %s\\en\", d-E<gt>d_reclen,\n"
713 "                    (long long) d-E<gt>d_off, (char *) d-E<gt>d_name);\n"
714 "            bpos += d-E<gt>d_reclen;\n"
715 "        }\n"
716 "    }\n"
717 msgstr ""
718
719 #. type: Plain text
720 #: build/C/man2/getdents.2:272
721 #, no-wrap
722 msgid ""
723 "    exit(EXIT_SUCCESS);\n"
724 "}\n"
725 msgstr ""
726
727 #. type: Plain text
728 #: build/C/man2/getdents.2:276
729 msgid "B<readdir>(2), B<readdir>(3)"
730 msgstr ""
731
732 #. type: TH
733 #: build/C/man3/getdirentries.3:27
734 #, no-wrap
735 msgid "GETDIRENTRIES"
736 msgstr ""
737
738 #. type: TH
739 #: build/C/man3/getdirentries.3:27
740 #, no-wrap
741 msgid "2007-07-26"
742 msgstr ""
743
744 #. type: TH
745 #: build/C/man3/getdirentries.3:27 build/C/man3/opendir.3:30 build/C/man3/scandir.3:34
746 #, no-wrap
747 msgid "GNU"
748 msgstr ""
749
750 #. type: Plain text
751 #: build/C/man3/getdirentries.3:30
752 msgid "getdirentries - get directory entries in a file system-independent format"
753 msgstr ""
754
755 #. type: Plain text
756 #: build/C/man3/getdirentries.3:35
757 msgid ""
758 "B<ssize_t getdirentries(int >I<fd>B<, char *>I<buf>B<, size_t >I<nbytes> B<, "
759 "off_t *>I<basep>B<);>"
760 msgstr ""
761
762 #. type: Plain text
763 #: build/C/man3/getdirentries.3:43
764 msgid "B<getdirentries>(): _BSD_SOURCE || _SVID_SOURCE"
765 msgstr ""
766
767 #. type: Plain text
768 #: build/C/man3/getdirentries.3:56
769 msgid ""
770 "Read directory entries from the directory specified by I<fd> into I<buf>.  "
771 "At most I<nbytes> are read.  Reading starts at offset I<*basep>, and "
772 "I<*basep> is updated with the new position after reading."
773 msgstr ""
774
775 #. type: Plain text
776 #: build/C/man3/getdirentries.3:62
777 msgid ""
778 "B<getdirentries>()  returns the number of bytes read or zero when at the end "
779 "of the directory.  If an error occurs, -1 is returned, and I<errno> is set "
780 "appropriately."
781 msgstr ""
782
783 #. type: Plain text
784 #: build/C/man3/getdirentries.3:64
785 msgid "See the Linux library source code for details."
786 msgstr ""
787
788 #. type: Plain text
789 #: build/C/man3/getdirentries.3:72
790 msgid ""
791 "Not in POSIX.1-2001.  Present on the BSDs, and a few other systems.  Use "
792 "B<opendir>(3)  and B<readdir>(3)  instead."
793 msgstr ""
794
795 #. type: Plain text
796 #: build/C/man3/getdirentries.3:75
797 msgid "B<lseek>(2), B<open>(2)"
798 msgstr ""
799
800 #. type: TH
801 #: build/C/man3/opendir.3:30
802 #, no-wrap
803 msgid "OPENDIR"
804 msgstr ""
805
806 #. type: TH
807 #: build/C/man3/opendir.3:30
808 #, no-wrap
809 msgid "2010-06-20"
810 msgstr ""
811
812 #. type: Plain text
813 #: build/C/man3/opendir.3:33
814 msgid "opendir, fdopendir - open a directory"
815 msgstr ""
816
817 #. type: Plain text
818 #: build/C/man3/opendir.3:41
819 #, no-wrap
820 msgid ""
821 "B<DIR *opendir(const char *>I<name>B<);>\n"
822 "B<DIR *fdopendir(int >I<fd>B<);>\n"
823 msgstr ""
824
825 #. type: Plain text
826 #: build/C/man3/opendir.3:49
827 msgid "B<fdopendir>():"
828 msgstr ""
829
830 #. type: TP
831 #: build/C/man3/opendir.3:52
832 #, no-wrap
833 msgid "Since glibc 2.10:"
834 msgstr ""
835
836 #. type: Plain text
837 #: build/C/man3/opendir.3:55
838 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
839 msgstr ""
840
841 #. type: TP
842 #: build/C/man3/opendir.3:55
843 #, no-wrap
844 msgid "Before glibc 2.10:"
845 msgstr ""
846
847 #. type: Plain text
848 #: build/C/man3/opendir.3:58
849 msgid "_GNU_SOURCE"
850 msgstr ""
851
852 #. type: Plain text
853 #: build/C/man3/opendir.3:67
854 msgid ""
855 "The B<opendir>()  function opens a directory stream corresponding to the "
856 "directory I<name>, and returns a pointer to the directory stream.  The "
857 "stream is positioned at the first entry in the directory."
858 msgstr ""
859
860 #. type: Plain text
861 #: build/C/man3/opendir.3:81
862 msgid ""
863 "The B<fdopendir>()  function is like B<opendir>(), but returns a directory "
864 "stream for the directory referred to by the open file descriptor I<fd>.  "
865 "After a successful call to B<fdopendir>(), I<fd> is used internally by the "
866 "implementation, and should not otherwise be used by the application."
867 msgstr ""
868
869 #. type: Plain text
870 #: build/C/man3/opendir.3:90
871 msgid ""
872 "The B<opendir>()  and B<fdopendir>()  functions return a pointer to the "
873 "directory stream.  On error, NULL is returned, and I<errno> is set "
874 "appropriately."
875 msgstr ""
876
877 #. type: TP
878 #: build/C/man3/opendir.3:91
879 #, no-wrap
880 msgid "B<EACCES>"
881 msgstr ""
882
883 #. type: Plain text
884 #: build/C/man3/opendir.3:94
885 msgid "Permission denied."
886 msgstr ""
887
888 #. type: Plain text
889 #: build/C/man3/opendir.3:98
890 msgid "I<fd> is not a valid file descriptor opened for reading."
891 msgstr ""
892
893 #. type: TP
894 #: build/C/man3/opendir.3:98
895 #, no-wrap
896 msgid "B<EMFILE>"
897 msgstr ""
898
899 #. type: Plain text
900 #: build/C/man3/opendir.3:101
901 msgid "Too many file descriptors in use by process."
902 msgstr ""
903
904 #. type: TP
905 #: build/C/man3/opendir.3:101
906 #, no-wrap
907 msgid "B<ENFILE>"
908 msgstr ""
909
910 #. type: Plain text
911 #: build/C/man3/opendir.3:104
912 msgid "Too many files are currently open in the system."
913 msgstr ""
914
915 #. type: Plain text
916 #: build/C/man3/opendir.3:107
917 msgid "Directory does not exist, or I<name> is an empty string."
918 msgstr ""
919
920 #. type: TP
921 #: build/C/man3/opendir.3:107 build/C/man3/scandir.3:107
922 #, no-wrap
923 msgid "B<ENOMEM>"
924 msgstr ""
925
926 #. type: Plain text
927 #: build/C/man3/opendir.3:110 build/C/man3/scandir.3:110
928 msgid "Insufficient memory to complete the operation."
929 msgstr ""
930
931 #. type: Plain text
932 #: build/C/man3/opendir.3:113
933 msgid "I<name> is not a directory."
934 msgstr ""
935
936 #. type: SH
937 #: build/C/man3/opendir.3:113 build/C/man3/scandir.3:113 build/C/man3/scandirat.3:103
938 #, no-wrap
939 msgid "VERSIONS"
940 msgstr ""
941
942 #. type: Plain text
943 #: build/C/man3/opendir.3:116
944 msgid "B<fdopendir>()  is available in glibc since version 2.4."
945 msgstr ""
946
947 #. type: Plain text
948 #: build/C/man3/opendir.3:121
949 msgid ""
950 "B<opendir>()  is present on SVr4, 4.3BSD, and specified in POSIX.1-2001.  "
951 "B<fdopendir>()  is specified in POSIX.1-2008."
952 msgstr ""
953
954 #. type: Plain text
955 #: build/C/man3/opendir.3:124
956 msgid ""
957 "The underlying file descriptor of the directory stream can be obtained using "
958 "B<dirfd>(3)."
959 msgstr ""
960
961 #. type: Plain text
962 #: build/C/man3/opendir.3:138
963 msgid ""
964 "The B<opendir>()  function sets the close-on-exec flag for the file "
965 "descriptor underlying the I<DIR *>.  The B<fdopendir>()  function leaves the "
966 "setting of the close-on-exec flag unchanged for the file descriptor, I<fd>.  "
967 "POSIX.1-200x leaves it unspecified whether a successful call to "
968 "B<fdopendir>()  will set the close-on-exec flag for the file descriptor, "
969 "I<fd>."
970 msgstr ""
971
972 #. type: Plain text
973 #: build/C/man3/opendir.3:147
974 msgid ""
975 "B<open>(2), B<closedir>(3), B<dirfd>(3), B<readdir>(3), B<rewinddir>(3), "
976 "B<scandir>(3), B<seekdir>(3), B<telldir>(3)"
977 msgstr ""
978
979 #. type: TH
980 #: build/C/man2/readdir.2:28 build/C/man3/readdir.3:34
981 #, no-wrap
982 msgid "READDIR"
983 msgstr ""
984
985 #. type: TH
986 #: build/C/man2/readdir.2:28
987 #, no-wrap
988 msgid "2008-10-02"
989 msgstr ""
990
991 #. type: Plain text
992 #: build/C/man2/readdir.2:31
993 msgid "readdir - read directory entry"
994 msgstr ""
995
996 #. type: Plain text
997 #: build/C/man2/readdir.2:36
998 #, no-wrap
999 msgid ""
1000 "B<int readdir(unsigned int >I<fd>B<, struct old_linux_dirent *>I<dirp>B<,>\n"
1001 "B<            unsigned int >I<count>B<);>\n"
1002 msgstr ""
1003
1004 #. type: Plain text
1005 #: build/C/man2/readdir.2:45
1006 msgid ""
1007 "This is not the function you are interested in.  Look at B<readdir>(3)  for "
1008 "the POSIX conforming C library interface.  This page documents the bare "
1009 "kernel system call interface, which is superseded by B<getdents>(2)."
1010 msgstr ""
1011
1012 #. type: Plain text
1013 #: build/C/man2/readdir.2:59
1014 msgid ""
1015 "B<readdir>()  reads one I<old_linux_dirent> structure from the directory "
1016 "referred to by the file descriptor I<fd> into the buffer pointed to by "
1017 "I<dirp>.  The argument I<count> is ignored; at most one I<old_linux_dirent> "
1018 "structure is read."
1019 msgstr ""
1020
1021 #. type: Plain text
1022 #: build/C/man2/readdir.2:63
1023 msgid "The I<old_linux_dirent> structure is declared as follows:"
1024 msgstr ""
1025
1026 #. type: Plain text
1027 #: build/C/man2/readdir.2:72
1028 #, no-wrap
1029 msgid ""
1030 "struct old_linux_dirent {\n"
1031 "    long  d_ino;              /* inode number */\n"
1032 "    off_t d_off;              /* offset to this I<old_linux_dirent> */\n"
1033 "    unsigned short d_reclen;  /* length of this I<d_name> */\n"
1034 "    char  d_name[NAME_MAX+1]; /* filename (null-terminated) */\n"
1035 "}\n"
1036 msgstr ""
1037
1038 #. type: Plain text
1039 #: build/C/man2/readdir.2:86
1040 msgid ""
1041 "I<d_ino> is an inode number.  I<d_off> is the distance from the start of the "
1042 "directory to this I<old_linux_dirent>.  I<d_reclen> is the size of "
1043 "I<d_name>, not counting the terminating null byte.  I<d_name> is a "
1044 "null-terminated filename."
1045 msgstr ""
1046
1047 #. type: Plain text
1048 #: build/C/man2/readdir.2:92
1049 msgid ""
1050 "On success, 1 is returned.  On end of directory, 0 is returned.  On error, "
1051 "-1 is returned, and I<errno> is set appropriately."
1052 msgstr ""
1053
1054 #. type: Plain text
1055 #: build/C/man2/readdir.2:111
1056 msgid "This system call is Linux-specific."
1057 msgstr ""
1058
1059 #. type: Plain text
1060 #: build/C/man2/readdir.2:117
1061 msgid ""
1062 "Glibc does not provide a wrapper for this system call; call it using "
1063 "B<syscall>(2).  You will need to define the I<old_linux_dirent> structure "
1064 "yourself."
1065 msgstr ""
1066
1067 #. type: Plain text
1068 #: build/C/man2/readdir.2:120
1069 msgid "B<getdents>(2), B<readdir>(3)"
1070 msgstr ""
1071
1072 #. type: TH
1073 #: build/C/man3/readdir.3:34
1074 #, no-wrap
1075 msgid "2010-09-10"
1076 msgstr ""
1077
1078 #. type: Plain text
1079 #: build/C/man3/readdir.3:37
1080 msgid "readdir, readdir_r - read a directory"
1081 msgstr ""
1082
1083 #. type: Plain text
1084 #: build/C/man3/readdir.3:42
1085 #, no-wrap
1086 msgid "B<struct dirent *readdir(DIR *>I<dirp>B<);>\n"
1087 msgstr ""
1088
1089 #. type: Plain text
1090 #: build/C/man3/readdir.3:45
1091 #, no-wrap
1092 msgid ""
1093 "B<int readdir_r(DIR *>I<dirp>B<, struct dirent *>I<entry>B<, struct dirent "
1094 "**>I<result>B<);>\n"
1095 msgstr ""
1096
1097 #. type: Plain text
1098 #: build/C/man3/readdir.3:54
1099 msgid "B<readdir_r>():"
1100 msgstr ""
1101
1102 #. type: Plain text
1103 #: build/C/man3/readdir.3:57
1104 msgid ""
1105 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
1106 "|| _POSIX_SOURCE"
1107 msgstr ""
1108
1109 #. type: Plain text
1110 #: build/C/man3/readdir.3:67
1111 msgid ""
1112 "The B<readdir>()  function returns a pointer to a I<dirent> structure "
1113 "representing the next directory entry in the directory stream pointed to by "
1114 "I<dirp>.  It returns NULL on reaching the end of the directory stream or if "
1115 "an error occurred."
1116 msgstr ""
1117
1118 #. type: Plain text
1119 #: build/C/man3/readdir.3:71
1120 msgid "On Linux, the I<dirent> structure is defined as follows:"
1121 msgstr ""
1122
1123 #. type: Plain text
1124 #: build/C/man3/readdir.3:82
1125 #, no-wrap
1126 msgid ""
1127 "struct dirent {\n"
1128 "    ino_t          d_ino;       /* inode number */\n"
1129 "    off_t          d_off;       /* offset to the next dirent */\n"
1130 "    unsigned short d_reclen;    /* length of this record */\n"
1131 "    unsigned char  d_type;      /* type of file; not supported\n"
1132 "                                   by all file system types */\n"
1133 "    char           d_name[256]; /* filename */\n"
1134 "};\n"
1135 msgstr ""
1136
1137 #. type: Plain text
1138 #: build/C/man3/readdir.3:96
1139 msgid ""
1140 "The only fields in the I<dirent> structure that are mandated by POSIX.1 are: "
1141 "I<d_name>[], of unspecified size, with at most B<NAME_MAX> characters "
1142 "preceding the terminating null byte; and (as an XSI extension)  I<d_ino>.  "
1143 "The other fields are unstandardized, and not present on all systems; see "
1144 "NOTES below for some further details."
1145 msgstr ""
1146
1147 #. type: Plain text
1148 #: build/C/man3/readdir.3:102
1149 msgid ""
1150 "The data returned by B<readdir>()  may be overwritten by subsequent calls to "
1151 "B<readdir>()  for the same directory stream."
1152 msgstr ""
1153
1154 #. type: Plain text
1155 #: build/C/man3/readdir.3:117
1156 msgid ""
1157 "The B<readdir_r>()  function is a reentrant version of B<readdir>().  It "
1158 "reads the next directory entry from the directory stream I<dirp>, and "
1159 "returns it in the caller-allocated buffer pointed to by I<entry>.  (See "
1160 "NOTES for information on allocating this buffer.)  A pointer to the returned "
1161 "item is placed in I<*result>; if the end of the directory stream was "
1162 "encountered, then NULL is instead returned in I<*result>."
1163 msgstr ""
1164
1165 #. type: Plain text
1166 #: build/C/man3/readdir.3:132
1167 msgid ""
1168 "On success, B<readdir>()  returns a pointer to a I<dirent> structure.  (This "
1169 "structure may be statically allocated; do not attempt to B<free>(3)  it.)  "
1170 "If the end of the directory stream is reached, NULL is returned and I<errno> "
1171 "is not changed.  If an error occurs, NULL is returned and I<errno> is set "
1172 "appropriately."
1173 msgstr ""
1174
1175 #. type: Plain text
1176 #: build/C/man3/readdir.3:141
1177 msgid ""
1178 "The B<readdir_r>()  function returns 0 on success.  On error, it returns a "
1179 "positive error number (listed under ERRORS).  If the end of the directory "
1180 "stream is reached, B<readdir_r>()  returns 0, and returns NULL in "
1181 "I<*result>."
1182 msgstr ""
1183
1184 #. type: Plain text
1185 #: build/C/man3/readdir.3:147 build/C/man3/rewinddir.3:51
1186 msgid "SVr4, 4.3BSD, POSIX.1-2001."
1187 msgstr ""
1188
1189 #. type: Plain text
1190 #: build/C/man3/readdir.3:163
1191 msgid ""
1192 "Only the fields I<d_name> and I<d_ino> are specified in POSIX.1-2001.  The "
1193 "remaining fields are available on many, but not all systems.  Under glibc, "
1194 "programs can check for the availability of the fields not defined in POSIX.1 "
1195 "by testing whether the macros B<_DIRENT_HAVE_D_NAMLEN>, "
1196 "B<_DIRENT_HAVE_D_RECLEN>, B<_DIRENT_HAVE_D_OFF>, or B<_DIRENT_HAVE_D_TYPE> "
1197 "are defined."
1198 msgstr ""
1199
1200 #. type: Plain text
1201 #: build/C/man3/readdir.3:176
1202 msgid ""
1203 "Other than Linux, the I<d_type> field is available mainly only on BSD "
1204 "systems.  This field makes it possible to avoid the expense of calling "
1205 "B<lstat>(2)  if further actions depend on the type of the file.  If the "
1206 "B<_BSD_SOURCE> feature test macro is defined, then glibc defines the "
1207 "following macro constants for the value returned in I<d_type>:"
1208 msgstr ""
1209
1210 #. type: Plain text
1211 #: build/C/man3/readdir.3:207
1212 msgid ""
1213 "If the file type could not be determined, the value B<DT_UNKNOWN> is "
1214 "returned in I<d_type>."
1215 msgstr ""
1216
1217 #. type: Plain text
1218 #: build/C/man3/readdir.3:226
1219 msgid ""
1220 "Since POSIX.1 does not specify the size of the I<d_name> field, and other "
1221 "nonstandard fields may precede that field within the I<dirent> structure, "
1222 "portable applications that use B<readdir_r>()  should allocate the buffer "
1223 "whose address is passed in I<entry> as follows:"
1224 msgstr ""
1225
1226 #. type: Plain text
1227 #: build/C/man3/readdir.3:232
1228 #, no-wrap
1229 msgid ""
1230 "len = offsetof(struct dirent, d_name) +\n"
1231 "          pathconf(dirpath, _PC_NAME_MAX) + 1\n"
1232 "entryp = malloc(len);\n"
1233 msgstr ""
1234
1235 #. type: Plain text
1236 #: build/C/man3/readdir.3:239
1237 msgid "(POSIX.1 requires that I<d_name> is the last field in a I<struct dirent>.)"
1238 msgstr ""
1239
1240 #. type: Plain text
1241 #: build/C/man3/readdir.3:251
1242 msgid ""
1243 "B<getdents>(2), B<read>(2), B<closedir>(3), B<dirfd>(3), B<ftw>(3), "
1244 "B<offsetof>(3), B<opendir>(3), B<rewinddir>(3), B<scandir>(3), "
1245 "B<seekdir>(3), B<telldir>(3)"
1246 msgstr ""
1247
1248 #. type: TH
1249 #: build/C/man3/rewinddir.3:29
1250 #, no-wrap
1251 msgid "REWINDDIR"
1252 msgstr ""
1253
1254 #. type: TH
1255 #: build/C/man3/rewinddir.3:29
1256 #, no-wrap
1257 msgid "1995-06-11"
1258 msgstr ""
1259
1260 #. type: Plain text
1261 #: build/C/man3/rewinddir.3:32
1262 msgid "rewinddir - reset directory stream"
1263 msgstr ""
1264
1265 #. type: Plain text
1266 #: build/C/man3/rewinddir.3:39
1267 #, no-wrap
1268 msgid "B<void rewinddir(DIR *>I<dirp>B<);>\n"
1269 msgstr ""
1270
1271 #. type: Plain text
1272 #: build/C/man3/rewinddir.3:45
1273 msgid ""
1274 "The B<rewinddir>()  function resets the position of the directory stream "
1275 "I<dirp> to the beginning of the directory."
1276 msgstr ""
1277
1278 #. type: Plain text
1279 #: build/C/man3/rewinddir.3:49
1280 msgid "The B<rewinddir>()  function returns no value."
1281 msgstr ""
1282
1283 #. type: Plain text
1284 #: build/C/man3/rewinddir.3:58
1285 msgid ""
1286 "B<closedir>(3), B<opendir>(3), B<readdir>(3), B<scandir>(3), B<seekdir>(3), "
1287 "B<telldir>(3)"
1288 msgstr ""
1289
1290 #. type: TH
1291 #: build/C/man3/scandir.3:34
1292 #, no-wrap
1293 msgid "SCANDIR"
1294 msgstr ""
1295
1296 #. type: TH
1297 #: build/C/man3/scandir.3:34
1298 #, no-wrap
1299 msgid "2012-04-26"
1300 msgstr ""
1301
1302 #. type: Plain text
1303 #: build/C/man3/scandir.3:37
1304 msgid "scandir, alphasort, versionsort - scan a directory for matching entries"
1305 msgstr ""
1306
1307 #. type: Plain text
1308 #: build/C/man3/scandir.3:42
1309 #, no-wrap
1310 msgid "B<int scandir(const char *>I<dirp>B<, struct dirent ***>I<namelist>B<,>\n"
1311 msgstr ""
1312
1313 #. type: Plain text
1314 #: build/C/man3/scandir.3:45 build/C/man3/scandirat.3:43
1315 #, no-wrap
1316 msgid ""
1317 "B<int (*>I<filter>B<)(const struct dirent *),>\n"
1318 "B<int (*>I<compar>B<)(const struct dirent **, const struct dirent **));>\n"
1319 msgstr ""
1320
1321 #. type: Plain text
1322 #: build/C/man3/scandir.3:48
1323 #, no-wrap
1324 msgid "B<int alphasort(const void *>I<a>B<, const void *>I<b>B<);>\n"
1325 msgstr ""
1326
1327 #. type: Plain text
1328 #: build/C/man3/scandir.3:50
1329 #, no-wrap
1330 msgid "B<int versionsort(const void *>I<a>B<, const void *>I<b>B<);>\n"
1331 msgstr ""
1332
1333 #. type: Plain text
1334 #: build/C/man3/scandir.3:60
1335 msgid "B<scandir>(), B<alphasort>(): _BSD_SOURCE || _SVID_SOURCE"
1336 msgstr ""
1337
1338 #. type: Plain text
1339 #: build/C/man3/scandir.3:63
1340 msgid "B<versionsort>(): _GNU_SOURCE"
1341 msgstr ""
1342
1343 #. type: Plain text
1344 #: build/C/man3/scandir.3:78
1345 msgid ""
1346 "The B<scandir>()  function scans the directory I<dirp>, calling I<filter>() "
1347 "on each directory entry.  Entries for which I<filter>() returns nonzero are "
1348 "stored in strings allocated via B<malloc>(3), sorted using B<qsort>(3)  with "
1349 "the comparison function I<compar>(), and collected in array I<namelist> "
1350 "which is allocated via B<malloc>(3).  If I<filter> is NULL, all entries are "
1351 "selected."
1352 msgstr ""
1353
1354 #. type: Plain text
1355 #: build/C/man3/scandir.3:90
1356 msgid ""
1357 "The B<alphasort>()  and B<versionsort>()  functions can be used as the "
1358 "comparison function I<compar>().  The former sorts directory entries using "
1359 "B<strcoll>(3), the latter using B<strverscmp>(3)  on the strings "
1360 "I<(*a)-E<gt>d_name> and I<(*b)-E<gt>d_name>."
1361 msgstr ""
1362
1363 #. type: Plain text
1364 #: build/C/man3/scandir.3:95
1365 msgid ""
1366 "The B<scandir>()  function returns the number of directory entries selected "
1367 "or -1 if an error occurs."
1368 msgstr ""
1369
1370 #. type: Plain text
1371 #: build/C/man3/scandir.3:103
1372 msgid ""
1373 "The B<alphasort>()  and B<versionsort>()  functions return an integer less "
1374 "than, equal to, or greater than zero if the first argument is considered to "
1375 "be respectively less than, equal to, or greater than the second."
1376 msgstr ""
1377
1378 #. type: Plain text
1379 #: build/C/man3/scandir.3:107
1380 msgid "The path in I<dirp> does not exist."
1381 msgstr ""
1382
1383 #. type: Plain text
1384 #: build/C/man3/scandir.3:113
1385 msgid "The path in I<dirp> is not a directory."
1386 msgstr ""
1387
1388 #. type: Plain text
1389 #: build/C/man3/scandir.3:116
1390 msgid "B<versionsort>()  was added to glibc in version 2.1."
1391 msgstr ""
1392
1393 #. type: Plain text
1394 #: build/C/man3/scandir.3:123
1395 msgid ""
1396 "B<alphasort>()  and B<scandir>()  are specified in POSIX.1-2008, and are "
1397 "widely available.  B<versionsort>()  is a GNU extension."
1398 msgstr ""
1399
1400 #. type: Plain text
1401 #: build/C/man3/scandir.3:130
1402 msgid ""
1403 "The functions B<scandir>()  and B<alphasort>()  are from 4.3BSD, and have "
1404 "been available under Linux since libc4.  Libc4 and libc5 use the more "
1405 "precise prototype"
1406 msgstr ""
1407
1408 #. type: Plain text
1409 #: build/C/man3/scandir.3:134
1410 #, no-wrap
1411 msgid ""
1412 "    int alphasort(const struct dirent ** a,\n"
1413 "                  const struct dirent **b);\n"
1414 msgstr ""
1415
1416 #. type: Plain text
1417 #: build/C/man3/scandir.3:137
1418 msgid "but glibc 2.0 returns to the imprecise BSD prototype."
1419 msgstr ""
1420
1421 #. type: Plain text
1422 #: build/C/man3/scandir.3:141
1423 msgid ""
1424 "The function B<versionsort>()  is a GNU extension, available since glibc "
1425 "2.1."
1426 msgstr ""
1427
1428 #. type: Plain text
1429 #: build/C/man3/scandir.3:148
1430 msgid ""
1431 "Since glibc 2.1, B<alphasort>()  calls B<strcoll>(3); earlier it used "
1432 "B<strcmp>(3)."
1433 msgstr ""
1434
1435 #. type: Plain text
1436 #: build/C/man3/scandir.3:153
1437 #, no-wrap
1438 msgid ""
1439 "#define _SVID_SOURCE\n"
1440 "/* print files in current directory in reverse order */\n"
1441 "#include E<lt>dirent.hE<gt>\n"
1442 msgstr ""
1443
1444 #. type: Plain text
1445 #: build/C/man3/scandir.3:159
1446 #, no-wrap
1447 msgid ""
1448 "int\n"
1449 "main(void)\n"
1450 "{\n"
1451 "    struct dirent **namelist;\n"
1452 "    int n;\n"
1453 msgstr ""
1454
1455 #. type: Plain text
1456 #: build/C/man3/scandir.3:171
1457 #, no-wrap
1458 msgid ""
1459 "    n = scandir(\".\", &namelist, NULL, alphasort);\n"
1460 "    if (n E<lt> 0)\n"
1461 "        perror(\"scandir\");\n"
1462 "    else {\n"
1463 "        while (n--) {\n"
1464 "            printf(\"%s\\en\", namelist[n]-E<gt>d_name);\n"
1465 "            free(namelist[n]);\n"
1466 "        }\n"
1467 "        free(namelist);\n"
1468 "    }\n"
1469 "}\n"
1470 msgstr ""
1471
1472 #. type: Plain text
1473 #: build/C/man3/scandir.3:184
1474 msgid ""
1475 "B<closedir>(3), B<fnmatch>(3), B<opendir>(3), B<readdir>(3), "
1476 "B<rewinddir>(3), B<scandirat>(3), B<seekdir>(3), B<strcmp>(3), "
1477 "B<strcoll>(3), B<strverscmp>(3), B<telldir>(3)"
1478 msgstr ""
1479
1480 #. type: TH
1481 #: build/C/man3/scandirat.3:26
1482 #, no-wrap
1483 msgid "SCANDIRAT"
1484 msgstr ""
1485
1486 #. type: TH
1487 #: build/C/man3/scandirat.3:26
1488 #, no-wrap
1489 msgid "2012-03-17"
1490 msgstr ""
1491
1492 #. type: Plain text
1493 #: build/C/man3/scandirat.3:29
1494 msgid "scandirat - scan a directory relative to a directory file descriptor"
1495 msgstr ""
1496
1497 #. type: Plain text
1498 #: build/C/man3/scandirat.3:32
1499 #, no-wrap
1500 msgid "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
1501 msgstr ""
1502
1503 #. type: Plain text
1504 #: build/C/man3/scandirat.3:35
1505 #, no-wrap
1506 msgid ""
1507 "B<#include E<lt>fcntl.hE<gt>>          /* Definition of AT_* constants */\n"
1508 "B<#include E<lt>dirent.hE<gt>>\n"
1509 msgstr ""
1510
1511 #. type: Plain text
1512 #: build/C/man3/scandirat.3:39
1513 msgid ""
1514 "B<int scandirat(int >I<dirfd>B<, const char *>I<dirp>B<,> B<struct dirent "
1515 "***>I<namelist>B<,>"
1516 msgstr ""
1517
1518 #. type: Plain text
1519 #: build/C/man3/scandirat.3:51
1520 msgid ""
1521 "The B<scandirat>()  system call operates in exactly the same way as "
1522 "B<scandir>(3), except for the differences described in this manual page."
1523 msgstr ""
1524
1525 #. type: Plain text
1526 #: build/C/man3/scandirat.3:61
1527 msgid ""
1528 "If the pathname given in I<dirp> is relative, then it is interpreted "
1529 "relative to the directory referred to by the file descriptor I<dirfd> "
1530 "(rather than relative to the current working directory of the calling "
1531 "process, as is done by B<scandir>(3)  for a relative pathname)."
1532 msgstr ""
1533
1534 #. type: Plain text
1535 #: build/C/man3/scandirat.3:73
1536 msgid ""
1537 "If I<dirp> is relative and I<dirfd> is the special value B<AT_FDCWD>, then "
1538 "I<dirp> is interpreted relative to the current working directory of the "
1539 "calling process (like B<scandir>(3))."
1540 msgstr ""
1541
1542 #. type: Plain text
1543 #: build/C/man3/scandirat.3:79
1544 msgid "If I<dirp> is absolute, then I<dirfd> is ignored."
1545 msgstr ""
1546
1547 #. type: Plain text
1548 #: build/C/man3/scandirat.3:86
1549 msgid ""
1550 "On success, B<scandirat>()  returns the number of directory entries "
1551 "selected.  On error, -1 is returned and I<errno> is set to indicate the "
1552 "error."
1553 msgstr ""
1554
1555 #. type: Plain text
1556 #: build/C/man3/scandirat.3:93
1557 msgid ""
1558 "The same errors that occur for B<scandir>(3)  can also occur for "
1559 "B<scandirat>().  The following additional errors can occur for "
1560 "B<scandirat>():"
1561 msgstr ""
1562
1563 #. type: Plain text
1564 #: build/C/man3/scandirat.3:97
1565 msgid "I<dirfd> is not a valid file descriptor."
1566 msgstr ""
1567
1568 #. type: Plain text
1569 #: build/C/man3/scandirat.3:103
1570 msgid ""
1571 "I<dirp> is a relative path and I<dirfd> is a file descriptor referring to a "
1572 "file other than a directory."
1573 msgstr ""
1574
1575 #. type: Plain text
1576 #: build/C/man3/scandirat.3:106
1577 msgid "B<scandirat>()  was added to glibc in version 2.15."
1578 msgstr ""
1579
1580 #. type: Plain text
1581 #: build/C/man3/scandirat.3:108
1582 msgid "This function is a GNU extension."
1583 msgstr ""
1584
1585 #. type: Plain text
1586 #: build/C/man3/scandirat.3:113
1587 msgid "See B<openat>(2)  for an explanation of the need for B<scandirat>()."
1588 msgstr ""
1589
1590 #. type: Plain text
1591 #: build/C/man3/scandirat.3:117
1592 msgid "B<openat>(2), B<scandir>(3), B<path_resolution>(7)"
1593 msgstr ""
1594
1595 #. type: TH
1596 #: build/C/man3/seekdir.3:28
1597 #, no-wrap
1598 msgid "SEEKDIR"
1599 msgstr ""
1600
1601 #. type: TH
1602 #: build/C/man3/seekdir.3:28 build/C/man3/telldir.3:28
1603 #, no-wrap
1604 msgid "2009-03-11"
1605 msgstr ""
1606
1607 #. type: Plain text
1608 #: build/C/man3/seekdir.3:32
1609 msgid ""
1610 "seekdir - set the position of the next readdir() call in the directory "
1611 "stream."
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: build/C/man3/seekdir.3:37
1616 #, no-wrap
1617 msgid "B<void seekdir(DIR *>I<dirp>B<, long >I<offset>B<);>\n"
1618 msgstr ""
1619
1620 #. type: Plain text
1621 #: build/C/man3/seekdir.3:46
1622 msgid "B<seekdir>(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE"
1623 msgstr ""
1624
1625 #. type: Plain text
1626 #: build/C/man3/seekdir.3:58
1627 msgid ""
1628 "The B<seekdir>()  function sets the location in the directory stream from "
1629 "which the next B<readdir>(2)  call will start.  B<seekdir>()  should be used "
1630 "with an I<offset> returned by B<telldir>(3)."
1631 msgstr ""
1632
1633 #. type: Plain text
1634 #: build/C/man3/seekdir.3:62
1635 msgid "The B<seekdir>()  function returns no value."
1636 msgstr ""
1637
1638 #. type: Plain text
1639 #: build/C/man3/seekdir.3:64 build/C/man3/telldir.3:64
1640 msgid "4.3BSD, POSIX.1-2001."
1641 msgstr ""
1642
1643 #. type: Plain text
1644 #: build/C/man3/seekdir.3:72
1645 msgid ""
1646 "In glibc up to version 2.1.1, the type of the I<offset> argument was "
1647 "I<off_t>.  POSIX.1-2001 specifies I<long>, and this is the type used since "
1648 "glibc 2.1.2."
1649 msgstr ""
1650
1651 #. type: Plain text
1652 #: build/C/man3/seekdir.3:80
1653 msgid ""
1654 "B<lseek>(2), B<closedir>(3), B<opendir>(3), B<readdir>(3), B<rewinddir>(3), "
1655 "B<scandir>(3), B<telldir>(3)"
1656 msgstr ""
1657
1658 #. type: TH
1659 #: build/C/man3/telldir.3:28
1660 #, no-wrap
1661 msgid "TELLDIR"
1662 msgstr ""
1663
1664 #. type: Plain text
1665 #: build/C/man3/telldir.3:31
1666 msgid "telldir - return current location in directory stream"
1667 msgstr ""
1668
1669 #. type: Plain text
1670 #: build/C/man3/telldir.3:36
1671 #, no-wrap
1672 msgid "B<long telldir(DIR *>I<dirp>B<);>\n"
1673 msgstr ""
1674
1675 #. type: Plain text
1676 #: build/C/man3/telldir.3:45
1677 msgid "B<telldir>(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE"
1678 msgstr ""
1679
1680 #. type: Plain text
1681 #: build/C/man3/telldir.3:50
1682 msgid ""
1683 "The B<telldir>()  function returns the current location associated with the "
1684 "directory stream I<dirp>."
1685 msgstr ""
1686
1687 #. type: Plain text
1688 #: build/C/man3/telldir.3:58
1689 msgid ""
1690 "On success, the B<telldir>()  function returns the current location in the "
1691 "directory stream.  On error, -1 is returned, and I<errno> is set "
1692 "appropriately."
1693 msgstr ""
1694
1695 #. type: Plain text
1696 #: build/C/man3/telldir.3:72
1697 msgid ""
1698 "In glibc up to version 2.1.1, the return type of B<telldir>()  was "
1699 "I<off_t>.  POSIX.1-2001 specifies I<long>, and this is the type used since "
1700 "glibc 2.1.2."
1701 msgstr ""
1702
1703 #. type: Plain text
1704 #: build/C/man3/telldir.3:79
1705 msgid ""
1706 "B<closedir>(3), B<opendir>(3), B<readdir>(3), B<rewinddir>(3), "
1707 "B<scandir>(3), B<seekdir>(3)"
1708 msgstr ""