Re: [hatari-devel] ACSI max disk size

[ Thread Index | Date Index | More Archives ]

Am Thu, 26 May 2016 01:02:23 +0200
schrieb Vincent Rivière <vincent.riviere@xxxxxxxxxxx>:
> The code calls ftello() to determine the current position. But it
> used the 32-bit fseek() to got to the end of file. In this case,
> ftello() returns a wrong value. If I use fseeko() instead, then
> ftello() returns the right value. And IDE works on my image.
> More precisely:
> My IDE image file is exactly 4009549824 bytes, 0xEEFCE000 in
> hexadecimal.
> - After fseeko(), ftello() returns 0x00000000EEFCE000 as expected.
> - After fseek(), ftello() returns  0xFFFFFFFFEEFCE000: that's bogus,
> it is as if the file offset was considered as signed 32-bit, then
> sign-extended to 64-bit.

That sounds like a bug in Cygwin, indeed.

> So:
> 1) In Hatari, please use fseeko() whenever you are going to call
> ftello(), specially in File_Length(). It is more consistent, doesn't
> hurt, and that's a workaround for Cygwin.

Ok, done.

> 2) I will file a bug for this issue at Cygwin. If this strange result
> is expected, it should at least be documented.

I'm curious, please let us know the results!


Mail converted by MHonArc 2.6.19+