[GRASS-dev] Re: About the vector changes
glynn at gclements.plus.com
Sun Aug 9 15:24:23 EDT 2009
Markus Metz wrote:
> > The build system changes are straigtforward; just set
> > _FILE_OFFSET_BITS in config.h (this is already done, but it's
> > conditional upon USE_LARGEFILES, which doesn't get set).
> I thought USE_LARGEFILES is set in configure and passed to
> Platform.make.in line 248
It's defined as a Makefile variable, not as a preprocessor macro.
> > The effort is in ensuring that code doesn't fail in inconvenient ways
> > (i.e. corrupting data) when dealing with files >2GiB, i.e. converting
> > everything to use off_t.
> Is it possible that configure sets LFS_FLAGS as a result of the LFS
> tests which are stolen from cdrtools and in aclocal.m4?
> It would be easier if configure could check if all we need is
> _FILE_OFFSET_BITS and not also conditionally _LARGE_FILES,
> _LARGEFILE_SOURCE, -n32 for LFS to work on 32bit systems.
Until everything is made LFS-aware, we need the separate macros so
that modules can use specific features without having to worry about
libraries which may not be LFS-aware.
OTOH, we're already in trouble due to the whole of lib/gis using
_FILE_OFFSET_BITS=64. This means that G_fopen_old() etc will open
files >2GiB, even though the caller may not be LFS-aware.
Unfortunately, there isn't an fopen32(). Once you set
_FILE_OFFSET_BITS=64, there's no way to get at the original 32-bit
fopen() function for specific cases.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev