[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Bug in stat in FreeMiNT ??



Can someone else try this test program.

I don't think it's a bug in MiNTlib as it pretty much hands off these
calls straight to syscalls into FreeMiNT's kernel.

The output I get is...

54093 54093 54093 54093
0 2 0 2

Note that the "0 2 0 2" line is wrong and it should be "2 2 2 2" to
indicate the device (in this case C:).

You'll need to change the stat line to a real existing file.

It happens on ext2 volumes as well, so I suspect it's something in the
generic FreeMiNT code.

The problem also happens with fstat() with appropriate open/close calls
to get a file descriptor.

Alan.

#include <stdio.h>
#include <sys/stat.h>

main()
{
       struct stat l,m,n,o;

       stat("c:\\mint\\mint.cnf",&l);
	stat("c:\\mint\\mint.cnf",&m);
	stat("c:\\mint\\mint.cnf",&n);
	stat("c:\\mint\\mint.cnf",&o);
 
	printf("%d %d %d %d\n",l.st_ino,m.st_ino,n.st_ino,o.st_ino);
       printf("%d %d %d %d\n",l.st_dev,m.st_dev,n.st_dev,o.st_dev);
}