File: getmntent.3

package info (click to toggle)
manpages-de 0.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,188 kB
  • ctags: 9
  • sloc: makefile: 83; perl: 61
file content (158 lines) | stat: -rw-r--r-- 4,403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\"     386BSD man pages
.\" Modified Sat Jul 24 21:46:57 1993 by Rik Faith <faith@cs.unc.edu>
.\" Translated into german 05 August 1996 by Markus Kaufmann
.\"                                        <markus.kaufmann@gmx.de>
.\"
.TH GETMNTENT 3  "6. Juni 1996" "" "Linux Bibliotheksfunktionen"
.SH BEZEICHNUNG
getmntent, setmntent, addmntent, endmntent, hasmntopt \- Lesen des
Dateieintrages des Dateisystemdeskriptors
.SH ÜBERSICHT
.nf
.B #include <stdio.h>
.B #include <mntent.h>
.sp
.BI "FILE *setmntent(const char *" filep ", const char *" type );
.sp
.BI "struct mntent *getmntent(FILE *" filep );
.sp
.BI "int addmntent(FILE *" filep ", const struct mntent *" mnt );
.sp
.BI "int endmntent(FILE *" filep );
.sp
.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt );
.fi
.SH BESCHREIBUNG
Diese Routinen werden benutzt, um auf die Dateien
.IR /etc/fstab ,
die die Liste der Dateisysteme enthält und die Datei
.IR /etc/mtab ,
die die Liste der zurzeit gemounteten Dateisysteme enthält, zuzugreifen.
.PP
Die
.BR setmntent() -Funktion
öffnet die Dateisystembeschreibungsdatei
.I filep
und liefert einen Dateizeiger zurück, der von 
.B getmntent()
benutzt werden kann.
Das Argument 
.I type
ist die Art des benötigten Zugriffs und kann die selben Werte annehmen
wie das
.IR mode -Argument 
von fopen(3).
.PP
Die 
.BR getmntent() -Funktion
liest die nächste Zeile von der Dateisystembeschreibungsdatei
.I filep
und liefert einen Zeiger auf Struktur zurück, die die einzelnen Felder der
gelesenen Zeile enthält.
Der Zeiger zeigt auf einen statischen Speicherbereich, der von den folgenden 
.BR getmntent() -Aufrufen
wieder überschrieben wird.
.PP
Die
.BR addmntent() -Funktion
fügt die mntent-Struktur 
.I mnt
an das Ende der offenen Datei
.I filep.
.PP
Die 
.BR endmntent() -Funktion
schließt die Dateisystembeschreibungsdatei
.I filep.
.PP
Die 
.BR hasmntopt() -Funktion
durchsucht das
.IR mnt_opts -Feld
(siehe unten)
der mntent-Struktur
.I mnt
nach einem Teilstring der auf
.I mnt
passt.
Gültige mount-Optionen sind unter
.I <mntent.h>
zu finden.
.PP
Die
.IR mntent -Struktur
ist in
.I <mntent.h>
folgendermaßen definiert:
.sp
.RS
.nf
.ne 8
.ta 8n 16n 32n
struct mntent {
	char 	*mnt_fsname;	/* Name des gemounteten Dateisystems */
	char	*mnt_dir;	/* Dateisystempfadprefix */
	char	*mnt_type;	/* Mounttyp (siehe mntent.h) */
	char	*mnt_opts;	/* Mount Optionen (siehe mntent.h) */
	int	mnt_freq;	/* Dumphäufigkeit in Tagen */
     	int	mnt_passno;	/* Durchgangsnummer beim parallelen fsck */
};
.ta
.fi
.RE
.SH "RÜCKGABEWERTE"
Die 
.BR getmntent() -Funktion 
liefert einen Pointer auf eine mntent-Struktur
zurück oder NULL bei einem Fehler. 
.PP
Die 
.BR addmntent() -Funktion 
liefert bei Erfolg eine 0 zurück, bei einem Fehler
dagegen eine 1.
.PP
Die
.BR endmntent()- Funktion 
liefert immer eine 1 zurück.
.PP
Die 
.BR hasmntopt() -Funktion
liefert die Adresse des Substrings oder NULL wenn er nicht gefunden 
werden konnte.
.SH DATEIEN
.TP
.I /etc/fstab
Dateisystembeschreibungsdatei
.I /etc/mtab
Enthält Liste der z.Zt. gemounteten Filesysteme
.fi
.SH "KONFORM ZU"
BSD 4.3
.SH "SIEHE AUCH"
.BR fopen (3),
.BR fstab (5).