OSDN Git Service

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