On Tue, Oct 06, 2020 at 09:59:20AM +0200, Øystein Schønning-Johansen wrote:
> Could be (I'm not sure as I have not tried) it helps if we change the type > of iOffset to unsigned long instead of long. Or maybe even type size_t, > which is probably the type the fseek() expects. > > No, answering myself...The above suggested fix is not going to work. > Checking the fseek() manual it actually expects long type offset as the > argument. This is probably by design, such that you can easily move > backwards in a file. Can you make a 64bit build? Maybe that will work. A possible plan could be to use POSIX off_t type and fseeko(), check that it still gives the same results as now, possibly after a few fixes, then try a #define _FILE_OFFSET_BITS 64, check that it gives the same results for small databases (although from a different, larger, file) and the right ones for larger databases, possibly after some more fixes. Even if the default builds stay with the 32 bits interface and databases of 2 GB or less, interested users could compile their own version and build larger databases.
