OSDN Git Service

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