OSDN Git Service

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