.\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl) .\" .\" 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. .\" .\" Inspired by a page written by Walter Harms. .\" .\" Traducido por Miguel Pérez Ibars el 25-julio-2004 .\" .TH GETFSENT 3 "28 febrero 2002" "Linux 2.5" "Manual del Programador de Linux" .SH NOMBRE getfsent, getfsspec, getfsfile, setfsent, endfsent \- manejo de entradas de fstab .SH SINOPSIS .B #include .sp .BI "void endfsent(void);" .sp .BI "struct fstab *getfsent(void);" .sp .BI "struct fstab *getfsfile(const char *" mount_point ); .sp .BI "struct fstab *getfsspec(const char *" special_file ); .sp .BI "int setfsent(void);" .SH DESCRIPCIÓN Estas funciones leen del fichero .IR /etc/fstab . La estructura fstab está definida por .LP .nf struct fstab { char *fs_spec; /* nombre del dispositivo de bloques */ char *fs_file; /* punto de montaje */ char *fs_vfstype; /* tipo de sistema de ficheros */ char *fs_mntops; /* opciones de montaje */ const char *fs_type; /* opción rw/rq/ro/sw/xx */ int fs_freq; /* frecuencia de volcado (dump), en días */ int fs_passno; /* número de paso en volcado paralelo */ }; .fi El campo .I fs_type contiene (en un sistema *BSD) una de las cinco cadenas "rw", "rq", "ro", "sw", "xx" (lectura-escritura, lectura-escritura con cuotas, sólo-lectura, intercambio (swap), ignorar). La función .B setfsent() abre el fichero cuando se le solicita y lo posiciona en la primera línea. .LP La función .B getfsent() analiza la siguiente línea del fichero. (Después de abrirlo si era necesario.) .LP La función .B endfsent() cierra el fichero cuando se le solicita. .LP La función .B getfsspec() busca en el fichero desde el principio y devuelve la primera entrada encontrada para la cual el campo .I fs_spec coincida con el argumento .I special_file. .LP La función .B getfsspec() busca en el fichero desde el principio y devuelve la primera entrada encontrada para la cual el campo .I fs_file coincida con el argumento .I mount_point. .SH "VALOR DEVUELTO" En caso de éxito, las funciones .BR getfsent() , .BR getfsfile() , y .BR getfsspec() devuelven un puntero a una estructura fstab, mientras que .BR setfsent() devuelve 1. En caso de fallo o fin de fichero, estas funciones devuelven NULL y 0, respectivamente. .SH HISTORIA La función .B getfsent() apareció en 4.0BSD; las otras cuatro funciones aparecieron en 4.3BSD. .SH "CONFORME A" Estas funciones no se encuentran en POSIX. Muchos sistemas operativos las tienen, p.e., *BSD, SunOS, Digital Unix, AIX (que también tiene una función .IR getfstype() ). HP-UX tiene funciones con los mismos nombres, que sin embargo usan una estructura checklist en lugar de una estructura fstab. Son consideradas obsoletas en este último, y reemplazadas por .BR getmntent (3). .SH OBSERVACIONES Estas funciones son hilo-seguro. .LP Puesto que Linux permite montar un dispositivo especial de bloques en diferentes lugares, y puesto que varios dispositivos pueden tener el mismo punto de montaje, donde el último dispositivo con un punto de montaje dado es el que cuenta, dado que .B getfsfile() y .B getfsspec() sólo devuelven la primera ocurrencia, estas dos funciones no son adecuadas para ser usadas bajo Linux. .LP .SH "VÉASE TAMBIÉN" .BR getmntent (3), .BR fstab (5)