[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gv] Fwd: Bug#497044: gv: does not work properly with files >~2g
From: |
Markus Steinborn |
Subject: |
Re: [bug-gv] Fwd: Bug#497044: gv: does not work properly with files >~2gb |
Date: |
Mon, 1 Sep 2008 18:35:38 +0200 (CEST) |
User-agent: |
Alpine 1.10 (LFD 962 2008-03-14) |
Hi Bernhard,
On Mon, 1 Sep 2008, Bernhard R. Link wrote:
----- Forwarded message from Marc Lehmann <debian-reportbug at plan9.de> -----
[...]
----- End forwarded message -----
Thanks for forwarding this bug report. Now it is present in the GNU
archives.
Fixing this looks a bit complicated (at least on 32 bit architectures,
on 64 bit architectures long is a bit longer and already helps).
I'd suggest to start with adding AC_SYS_LARGEFILE to configure.ac.
This tells autoconf that we want off_t to be 64 bit always. (This
is the default on things like BSDs anyway AFAIK, but Linux has still
quite "backward-compatible" defaults).[1]
On Saturday, I startet to make it working on X86_64 (by replacing chosen
int's by long's). It's working now on X86_64 (by a quick test).
Then it needs to make sure to actually use off_t. File descriptor
based functions usually use them, but file stream based not (problem
are fseek and ftell, I guess).
As it is working now on X86_64, I can be sure that all relevant variables
are of type long and so I can grep for them.
There are fseeko and ftello to help here (things using them need to be
off_t (or long long), though), those are relatively new functions
though. (my manpage says "SUSv2, POSIX.1-2001"), though this might
perhaps need a fallback to use fseek and ftell there for older
systems...
That is actually in progess - with some extension: The configure script
chooses wheather to
* use off64_t, fopen64, fseeko64, ftello64 and stat64
* use off_t, fopen, fseeko, ftello and stat
* use long, fopen, fseek, ftell and stat (as fallback).
I am not sure if the first option is really needed, but it does not hurt
anyway. You can expect a CVS checkin with that changes quite soon,
probably today.
Greetings
Markus Steinborn