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

Re: [MiNT] LFS?



Hi!

Fstat64() (a FreeMiNT GEMDOS extension syscall present since version 1.16) fills in the strust stat where all the relevant members are in fact 64 bit wide. This is supported by the kernel
and filesystems (ext2 has its own implementation).

Mintlib fakes the 'struct stat' to get 4 byte st_size by placing a 'ulong __st_hi_size' above that. So in theory one could get the right file size either by using the mentioned syscall
or by using the mintlib specific 'struct stat' members.

The right way of doing this, as noted by Petr over jabber, would probably be implementing
the the glibc style of LFS support directly inside mintlib.

STanda

PS: note that I haven't touched a real LFS support where there are all the seek/tell function signatures changed as well. I am writing just about getting the file size, which should be quite enough to read/write such files with the kernel/mintlib calls as they are present at the moment.


On Dec 15, 2008, at 9:20 AM, Alan Hourihane wrote:

On Mon, 2008-12-15 at 09:47 +0100, Petr Stehlik wrote:
Alan Hourihane píše v Ne 14. 12. 2008 v 17:20 +0000:
On Sun, 2008-12-14 at 16:14 +0100, Petr Stehlik wrote:
Hi all,

I am curious whether freemint and mintlib support 64bit file lengths. I
have written a simple printf(sizeof(struct stat.st_size)) kind of
program but couldn't compile it to get 64bit st_size...

I've seen some kind of STAT64 support in the kernel but don't know what
else is missing there.

No. Sorry.

Can someone be more specific, please? How far is kernel and where is the
mintlib?

On my travels through MiNTlib and the kernel, there are large portions
missing, and then a great testing effort.

Alan.