.\" 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) .\" Modified 961109, aeb .\" Translated into Spanish Tue Jan 27 1998 by Gerardo Aburruzaga .\" García .\" .TH GETMNTENT 3 "17 junio 1993" "" "Manual del Programador de Linux" .SH NOMBRE getmntent, setmntent, addmntent, endmntent, hasmntopt \- obtienen una entrada del fichero que describe los sistemas de ficheros .SH SINOPSIS .nf .B #include .B #include .sp .BI "FILE *setmntent(const char *" nombrefich ", const char *" tipo ); .sp .BI "struct mntent *getmntent(FILE *" pf ); .sp .BI "int addmntent(FILE *" pf ", const struct mntent *" mnt ); .sp .BI "int endmntent(FILE *" pf ); .sp .BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opc ); .fi .SH DESCRIPCIÓN Estas rutinas se emplean para acceder al fichero que describe los sistemas de ficheros, \fI/etc/fstab\fP, y el que describe los sistemas de ficheros que están montados, \fI/etc/mtab\fP. .PP La función \fBsetmntent()\fP abre el fichero de descripción de sistemas de ficheros, \fInombrefich\fP, y devuelve un puntero a FILE que puede ser usado por \fBgetmntent()\fP. El argumento \fItipo\fP es el tipo de acceso requerido y puede tomar los mismos valores que el argumento \fImodo\fP de .BR fopen(3). .PP La función \fBgetmntent()\fP lee la siguiente línea del fichero de descripción de sistemas de ficheros, \fIpf\fP, y devuelve un puntero a una estructura que contiene los campos descompuestos de una línea del fichero. El puntero apunta a un área estática de memoria que es sobreescrita en subsecuentes llamadas a \fBgetmntent()\fP. .PP La función \fBaddmntent()\fP añade la estructura mntent \fImnt\fP al final del fichero abierto \fIpf\fP. .PP La función \fBendmntent()\fP cierra el fichero de descripción de sistemas de ficheros \fIpf\fP. .PP La función \fBhasmntopt()\fP escudriña el campo \fImnt_opts\fP (ver más abajo) de la estructura mntent \fImnt\fP buscando una subcadena que concuerde con \fIopc\fP. Vea \fI\fP para opciones de montaje válidas. .PP La estructura \fImntent\fP se define en \fI\fP como sigue: .sp .RS .nf .ne 8 .ta 8n 16n 32n struct mntent { char *mnt_fsname; /* nombre del s.f. montado */ char *mnt_dir; /* prefijo del camino del s.f. */ char *mnt_type; /* tipo de montaje (vea mntent.h) */ char *mnt_opts; /* opciones de montaje (vea mntent.h) */ int mnt_freq; /* frecuencia de volcado (días) */ int mnt_passno; /* Nº de pasada en fsck paralelo */ }; .ta .fi .RE .SH "VALOR DEVUELTO" La función \fBgetmntent()\fP devuelve un puntero a la estructura mntent o NULL si falla. .PP La función \fBaddmntent()\fP devuelve 0 si acaba bien y 1 si acaba mal. .PP La función \fBendmntent()\fP siempre devuelve 1. .PP La función \fBhasmntopt()\fP devuelve la dirección de la cadena si se encuentra, y NULL en otro caso. .SH FICHEROS .nf /etc/fstab descripción de sistemas de ficheros /etc/mtab descripción de sistemas de ficheros montados .fi .SH "CONFORME A" SunOS 4.1.3 .SH OBSERVACIONES SysV incluye también una función \fBgetmntent()\fP, pero la secuencia de llamada es distinta y la estructura devuelta diferente. Bajo SysV se utiliza .I /etc/mnttab. BSD 4.4 y Digital Unix tienen una rutina \fBgetmntinfo()\fP, que es una envoltura para la llamada al sistema \fBgetfsstat()\fP. .SH "VÉASE TAMBIÉN" .BR fopen "(3), " fstab (5)