[Programación] Re: [Programación] Las fuentes del kernel 2.4 estan mal ???

Sebastián D. Criado programacion@lugro.org.ar
Wed, 6 Oct 2004 14:15:37 -0300


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Miércoles 06 Octubre 2004 11:37, Pablo escribió:
> Hola,
>
> Me pasa algo raro y quiero saber si a ustedes tambien.
>
> Tratando de leer los FS montados en el sistema a traves
> del mtab y sus funciones, me encontre con que dos
> #defines en los arch. fuentes del kernel, supongo, se refieren
> al mismo archivo.
>
> Segun:
> http://www.linuxselfhelp.com/gnu/glibc/html_chapter/libc_30.html
> (Que no es mas que el info del libc)
>
> esto debería ser lo correcto:
>
> "Traditionally Unix systems have a file named `/etc/fstab' which describes
> all possibly mounted filesystems. The mount program uses this file to mount
> at startup time of the system all the necessary filesystems. The
> information about all the filesystems actually mounted is normally kept in
> a file named `/etc/mtab'."
> ....
> "The filenames given above should never be used directly. The portable way
> to handle these file is to use the macros _PATH_FSTAB, defined in `fstab.h'
> and _PATH_MNTTAB, defined in `mntent.h', respectively."
>
> entonces _PATH_FSTAB es comunmente /etc/fstab y,
>              _PATH_MNTTAB es comunmente /etc/mtab.
>
> pero en mi sistema Slack 9 (ver detalle en adjunto) ambos apuntan al mismo
> archivo, el fstab.
>
> A algun otro le pasa lo mismo ? Adjunto un .c para probarlo. Compilar con
> $ gcc error_kernel_src.c
> $ ./a.out


Bueno, te cuento que en 2.6 los define que marcas apuntan también al mismo 
archivo, pero los mismos son diferentes y cumplen lo que indicabas.
El mtab tiene la lista de las particiones montadas actualmente y el fstab el 
que se montaran.

Ahora bien, el tema por lo que pudever esta en fstab.h y en path.h. Si te 
fijas, aunque el define de _PATH_MNTAB apunta al mismo archivo, no lo hace 
así el define _PATH_MOUNTED, que cumpliría lo que se especifica y aputa 
a /etc/mtab


saludos.-

- -- 

Sebastián D. Criado - scriado{en}ciudad.com.ar
L.U.G.R.o - http://www.lugro.org.ar
GNU/Linux Registered User # 146768
- -------------------------------------------------------------------
"Si el Universo fuera un programa estaría hecho en C, y correría sobre
un sistema UNIX"
                                                   Anónimo.

			
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBZCg68hmHQ8ZCg0IRApGZAKDABS10JBONmBwgYM9UzkHdtdJxkwCdGYmj
WrlfM8o7jEqrGpEGq+KfZVk=
=1vdV
-----END PGP SIGNATURE-----