.\" 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 .\" Translated into german 05 August 1996 by Markus Kaufmann .\" .\" .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 .B #include .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 zu finden. .PP Die .IR mntent -Struktur ist in .I 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).