OSDN Git Service

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