Imported tab->space correction by redhat
[infodrom/manpages-de] / man3 / getmntent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 21:46:57 1993 by Rik Faith <faith@cs.unc.edu>
28 .\" Translated into german 05 August 1996 by Markus Kaufmann
29 .\"                                        <markus.kaufmann@gmx.de>
30 .\"
31 .TH GETMNTENT 3  "6. Juni 1996" "" "Linux Bibliotheksfunktionen"
32 .SH BEZEICHNUNG
33 getmntent, setmntent, addmntent, endmntent, hasmntopt \- Lesen des
34 Dateieintrages des Dateisystemdeskriptors
35 .SH ÜBERSICHT
36 .nf
37 .B #include <stdio.h>
38 .B #include <mntent.h>
39 .sp
40 .BI "FILE *setmntent(const char *" filep ", const char *" type );
41 .sp
42 .BI "struct mntent *getmntent(FILE *" filep );
43 .sp
44 .BI "int addmntent(FILE *" filep ", const struct mntent *" mnt );
45 .sp
46 .BI "int endmntent(FILE *" filep );
47 .sp
48 .BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt );
49 .fi
50 .SH BESCHREIBUNG
51 Diese Routinen werden benutzt, um auf die Dateien
52 .IR /etc/fstab ,
53 die die Liste der Dateisysteme enthält und die Datei
54 .IR /etc/mtab ,
55 die die Liste der zurzeit gemounteten Dateisysteme enthält, zuzugreifen.
56 .PP
57 Die
58 .BR setmntent() -Funktion
59 öffnet die Dateisystembeschreibungsdatei
60 .I filep
61 und liefert einen Dateizeiger zurück, der von 
62 .B getmntent()
63 benutzt werden kann.
64 Das Argument 
65 .I type
66 ist die Art des benötigten Zugriffs und kann die selben Werte annehmen
67 wie das
68 .IR mode -Argument 
69 von fopen(3).
70 .PP
71 Die 
72 .BR getmntent() -Funktion
73 liest die nächste Zeile von der Dateisystembeschreibungsdatei
74 .I filep
75 und liefert einen Zeiger auf Struktur zurück, die die einzelnen Felder der
76 gelesenen Zeile enthält.
77 Der Zeiger zeigt auf einen statischen Speicherbereich, der von den folgenden 
78 .BR getmntent() -Aufrufen
79 wieder überschrieben wird.
80 .PP
81 Die
82 .BR addmntent() -Funktion
83 fügt die mntent-Struktur 
84 .I mnt
85 an das Ende der offenen Datei
86 .I filep.
87 .PP
88 Die 
89 .BR endmntent() -Funktion
90 schließt die Dateisystembeschreibungsdatei
91 .I filep.
92 .PP
93 Die 
94 .BR hasmntopt() -Funktion
95 durchsucht das
96 .IR mnt_opts -Feld
97 (siehe unten)
98 der mntent-Struktur
99 .I mnt
100 nach einem Teilstring der auf
101 .I mnt
102 passt.
103 Gültige mount-Optionen sind unter
104 .I <mntent.h>
105 zu finden.
106 .PP
107 Die
108 .IR mntent -Struktur
109 ist in
110 .I <mntent.h>
111 folgendermaßen definiert:
112 .sp
113 .RS
114 .nf
115 .ne 8
116 .ta 8n 16n 32n
117 struct mntent {
118         char    *mnt_fsname;    /* Name des gemounteten Dateisystems */
119         char    *mnt_dir;       /* Dateisystempfadprefix */
120         char    *mnt_type;      /* Mounttyp (siehe mntent.h) */
121         char    *mnt_opts;      /* Mount Optionen (siehe mntent.h) */
122         int     mnt_freq;       /* Dumphäufigkeit in Tagen */
123         int     mnt_passno;     /* Durchgangsnummer beim parallelen fsck */
124 };
125 .ta
126 .fi
127 .RE
128 .SH "RÜCKGABEWERTE"
129 Die 
130 .BR getmntent() -Funktion 
131 liefert einen Pointer auf eine mntent-Struktur
132 zurück oder NULL bei einem Fehler. 
133 .PP
134 Die 
135 .BR addmntent() -Funktion 
136 liefert bei Erfolg eine 0 zurück, bei einem Fehler
137 dagegen eine 1.
138 .PP
139 Die
140 .BR endmntent()- Funktion 
141 liefert immer eine 1 zurück.
142 .PP
143 Die 
144 .BR hasmntopt() -Funktion
145 liefert die Adresse des Substrings oder NULL wenn er nicht gefunden 
146 werden konnte.
147 .SH DATEIEN
148 .TP
149 .I /etc/fstab
150 Dateisystembeschreibungsdatei
151 .I /etc/mtab
152 Enthält Liste der z.Zt. gemounteten Filesysteme
153 .fi
154 .SH "KONFORM ZU"
155 BSD 4.3
156 .SH "SIEHE AUCH"
157 .BR fopen (3),
158 .BR fstab (5).