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

Pablo programacion@lugro.org.ar
Wed, 6 Oct 2004 11:37:12 -0300


This is a multi-part message in MIME format.

------=_NextPart_000_0031_01C4AB98.D28C3840
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

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

------=_NextPart_000_0031_01C4AB98.D28C3840
Content-Type: application/octet-stream;
	name="error_kernel_src.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="error_kernel_src.c"

/*=0A=
Slackware 9.1.0=0A=
Linux sist2 2.4.22 #6 Tue Sep 2 17:43:01 PDT 2003 i686 unknown unknown =
GNU/Linux=0A=
=0A=
Pablo Armando.=0A=
*/=0A=
=0A=
#include <stdio.h>=0A=
#include <fstab.h> =0A=
#include <mntent.h>=0A=
#include <paths.h>=0A=
=0A=
=0A=
int main()=0A=
{=0A=
	printf("Ambos apuntan al mismo archivo \n");=0A=
	printf("_PATH_MNTTAB =3D %s\n", _PATH_MNTTAB);=0A=
	printf("_PATH_FSTAB =3D %s\n", _PATH_FSTAB);=0A=
	if(strcmp(_PATH_MNTTAB, _PATH_FSTAB) =3D=3D 0)=0A=
	    printf("Mal los defines, son igualess?!\n");=0A=
	return 0;=0A=
}=0A=

------=_NextPart_000_0031_01C4AB98.D28C3840--