Imported tab->space correction by redhat
[infodrom/manpages-de] / man2 / readdir.2
1 .\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one
11 .\" 
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\" 
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Written 11 June 1995 by Andries Brouwer <aeb@cwi.nl>
24 .\" Modified 22 July 1995 by Michael Chastain <mec@duracef.shout.net>:
25 .\"   In 1.3.X, returns only one entry each time; return value is different.
26 .\" Translated into german 02 June 1996 by Markus Kaufmann
27 .\"                                        <markus.kaufmann@gmx.de>
28 .\" 
29 .TH READDIR 2  "2. Juni 1996" "Linux 1.3.6" "Systemaufrufe"
30 .SH BEZEICHNUNG
31 readdir \- liest einen Verzeichniseintrag
32 .SH ÜBERSICHT
33 .nf
34 .B #include <unistd.h>
35 .B #include <linux/dirent.h>
36 .B #include <linux/unistd.h>
37 .sp
38 .B _syscall3(int, readdir, uint, fd, struct dirent *, dirp, uint, count);
39 .sp
40 .BI "int readdir(unsigned int " fd ", struct dirent *" dirp ", unsigned int " count );
41 .fi
42 .SH BESCHREIBUNG
43 Dies ist nicht die Funktion, an der sie interessiert sind.
44 Unter
45 .BR readdir (3)
46 finden sie eine POSIX-konforme C-Funktion.
47 Diese Seite beschreibt den rohen Kernelsystemaufruf, der sich jederzeit
48 ändern kann und durch 
49 .BR getdents (2)
50 ersetzt wurde.
51 .PP
52 .B readdir
53 liest eine
54 .IR dirent \-Struktur
55 von dem Verzeichnis auf das die Variable 
56 .I fd
57 zeigt in den Speicher an die Stelle auf die 
58 .IR dirp 
59 zeigt.
60 Der Parameter 
61 .I count
62 wird ignoriert; es wird höchstens eine dirent-Struktur gelesen.
63 .PP
64 Die
65 .IR dirent -Struktur 
66 ist wie folgt deklariert:
67 .PP
68 .RS
69 .nf
70 struct dirent
71 {
72     long d_ino;                 /* inode Nummer */
73     off_t d_off;                /* Offset zu diesem \fIdirent\fP */
74     unsigned short d_reclen;    /* Länge von \fId_name\fP */
75     char d_name [NAME_MAX+1];   /* Dateiname (Null-terminiert) */
76 }
77 .fi
78 .RE
79 .PP
80 .I d_ino
81 ist eine Inode-Nummer.
82 .I d_off
83 ist der Abstand zwischen dem Beginn des Verzeichnisses und diesem 
84 .IR dirent .
85 .I d_reclen
86 ist die Länge von 
87 .IR d_name,
88 den abschließenden Null-terminator nicht mitgezählt.
89 .I d_name
90 ist ein Null-terminierter Dateiname.
91 .PP
92 .SH "RÜCKGABEWERT"
93 Bei Erfolg wird eine 1 zurückgeliefert.
94 Beim Ende eines Verzeichnisses wird eine 0 zurückgeliefert.
95 Beim Auftreten eines Fehlers wird \-1 zurückgeliefert und
96 .I errno
97 entsprechend gesetzt.
98 .SH "FEHLER"
99 .TP
100 .B EBADF
101 Ungültiger Dateideskriptor
102 .IR fd .
103 .TP
104 .B ENOTDIR
105 Dateideskriptor zeigt nicht auf ein Verzeichnis.
106 .SH "KONFORM ZU"
107 Dieser Systemaufruf ist Linuxspezifisch.
108 .SH "SIEHE AUCH"
109 .BR getdents (2),
110 .BR readdir (3).