[gdal-dev] Large Raw Files

ldjohn at u... ldjohn at u...
Mon Dec 17 11:18:05 EST 2001


On Sat, 15 Dec 2001, Frank Warmerdam wrote:

> I have added a check for ftello64/fseeko64 in GDAL's configure. Could
> you do a "make clean; cvs update -d; ./configure; make" on your Solaris 2.7
> system and see if it picks them up properly automatically?

Tested and passed. Thanks.

Upon further inspection, I've noted that Solaris (and Linux) also have
ftello/fseeko calls which are #defined to ftello64/fseeko64 calls
under certain macro definitions. I'm not sure which call format is
preferable. On our Solaris 2.7 machine, the man pages are only given for
the fseeko/ftello pair, not fseeko64/ftello64.

The existing LAS image I/O uses the fseeko/ftello pair combined with a
-D_FILE_OFFSET_BITS=64 GCC compiler flag to handle large files on Solaris.

I've retested by replacing fseeko64/ftello64 with fseeko/ftello in the
configure script, and it works fine as long as I have the
-D_FILE_OFFSET_BITS=64 compiler flag included. Without this flag, it
fails at 2GB.

I don't feel knowledgeable enough about the situation to say which
function pair should be used. Unless you or others have more information,
I'd say we just stick with the "64"s that you have implemented.

> Note, it seems that ftello64 and fseeko64 exist on Linux (at least mine)
> in the glibc, but they aren't normally defined in stdio.h (though they
> are there protected by a bunch of macros). I would be interested in
> knowning what we need to do to get 64 bit file io support on linux. What
> kernel, file system, api calls, etc.

I think that the 64 bit stuff can be used on 2.4+ kernels. Our existing
LAS image I/O layer has been built and tested for large files on the Linux
2.4 kernel, but our work boxes are still running 2.2 (Redhat 7.0), so it's
difficult for me to test at the moment. I do see, as you mention, that
the installed stdio.h includes references to the
fseeko(64)/ftello(64) pairs, wrapped in "#ifdef __USE_LARGEFILE"
preprocessor conditionals and others.


Lowell
-- 
--------------------------------------------------
Lowell D. Johnson
Software Engineering
Raytheon Systems
EROS Data Center
47914 252nd Street, Mundt Federal Bldg
Sioux Falls, SD 57198
--------------------------------------------------





More information about the Gdal-dev mailing list