64-bit stat (or not) in 32-bit Fedora binaries

John Reiser jreiser at bitwagon.com
Sat Mar 2 19:18:45 UTC 2013


On 02/18/2013 03:15 PM, Eric Sandeen wrote:
> On 2/18/13 5:11 PM, John Reiser wrote:

>> It would be useful to have a "backward compatibility" LD_PRELOAD shared
>> library ...

> Yep, that would make some sense as a workaround. ...

As proof of concept, I have constructed such a wrapper shared library.
It intercepts __xstat32_conv, always converts each member (modulo its
width, if necessary) and when EOVERFLOW would occur then it consults
environment variable _XSTAT32_EOVERFLOW for options:

   ignore    return 0 instead (success)
   error     return EOVERFLOW (like before, but st_size is defined!)
   warn      diagnose once on stderr; return EOVERFLOW
   abort     call abort()

The diagnostic tells which of st_ino, st_size, or st_nblock overflowed.

The construction script and related files to be used with glibc-*.src.rpm
are linked from the narrative description at:

   http://bitwagon.com/xstat32_EOVERFLOW/

-- 



More information about the devel mailing list