File: getfsent.3

package info (click to toggle)
manpages-es 1.55-9
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 7,468 kB
  • ctags: 6
  • sloc: sh: 1,629; makefile: 64
file content (131 lines) | stat: -rw-r--r-- 4,386 bytes parent folder | download | duplicates (4)
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
.\" 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 <mpi79470@alu.um.es> 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 <fstab.h>
.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)