[GRASS-dev] Re: About the vector changes
Glynn Clements
glynn at gclements.plus.com
Sat Aug 8 19:31:07 EDT 2009
Markus Metz wrote:
> > d.vect, etc use the libraries and VECT_CFLAGS, so it isn't just v.*
> > modules which need to be checked. It might just be v.* modules which
> > need to be fixed; I don't know.
>
> OK. I will check all modules including <grass/vector.h> or any of the
> headers in include/vect. All vector modules should be fixed by now. Of
> the raster modules, only r.drain needed fixing, all other were ok. But I
> will check again.
I suggest checking for VECT_CFLAGS in the Makefiles. If that is used
for compilation, <stdio.h> will use the LFS functions (fopen64 etc),
so the code needs to handle files >2GiB regardless of how (or if) it
uses the vector libraries.
> > ideally, we should use G_{fseek,ftell} everywhere. Ultimately, it
> > would be better to enable -D_FILE_OFFSET_BITS=64 globally (to ensure
> > that there aren't any cases where a FILE* is obtained via fopen64()
> > then passed to code which can't handle it), which means making
> > everything LFS-aware.
>
> That's beyond my scope because aclocal.m4 and configure.in need
> adjustment, and I won't touch these. I guess you are suitably qualified
> for the task ;-)
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).
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.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list