[gdal-dev] test failures on pkgsrc build of 3.3.2rc3

Even Rouault even.rouault at spatialys.com
Wed Sep 1 13:53:57 PDT 2021


> What's wrong with just always doing the stat?
Nothing, but just one extra system call in a performance critical path.
> Or, if it's really important to avoid the stat, put the code that makes
> beyond-POSIX assumptions under #ifdef linux.   Then we'd have code that
> is in general correct, and avoids a stat on systems known to not return
> any bytes on a directory.
>
I basically whitelisted OSs that are tested by our CI and for which 
fread() on a directory FILE* returns 0 and where we can save the stat() 
when it is a non-empty file, which is the nominal case for most GDAL usage.

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list