|Re: [hatari-devel] ACSI max disk size|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] ACSI max disk size
- From: Vincent Rivière <vincent.riviere@xxxxxxxxxxx>
- Date: Thu, 26 May 2016 01:02:23 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=7mb8NexNvSEqQxV6QG4bZIP8s7NlvmhMu4l23fRjoL8=; b=RuobUE1mf1FAvtEo1cHrnGqdbRBWvddyVl7iCU3fvRBVeoHRPHz+wLDiieY6w9E13e Kh3sVpszK5OGS9q5lcCLUjjllJVRhaeNWu2rOLlDER01v4gl/kIrVR4PF+QraCGgo0UM 9pYNAbMYg6Cmh5y3KHgEUp82tYn7WTyvzuxI0ZNf7fG7B6Yt22laNJz2/cMRrk4Kp6Sy nrfh6LQdHUbwRD84NttXdcKLN7Qz5PadTxxL5UAmP4EwdgzKqdsuwxGk4wieN5UxCqdz 6+uhIiFzHzbXbJFRFOXlcChdAaHcZJS/jktU1v/My1VzKb/tYPlBkzAIBjqm5qZ6FKek 4BfQ==
On 21/05/2016 à 13:00, Thomas Huth wrote:
Hmm, I just google a little bit for Cygwin large file support, and it
sounds like it should be in there ... could you please check
sizeof(off_t) there to see whether it is 4 or 8 bytes?
It is 8 bytes. Cygwin fully supports files >= 4 GB, even on 32-bit systems.
*BUT* I found something in Cygwin which really looks like a bug (or feature?).
In Hatari src/file.c, function File_Length().
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.
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
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.
2) I will file a bug for this issue at Cygwin. If this strange result is
expected, it should at least be documented.