[PATCH v2 28/46] statfs: Use statfs64 if arch does not have the statfs syscall
Rich Felker
dalias at aerifal.cx
Tue Nov 27 23:38:38 UTC 2012
On Tue, Nov 27, 2012 at 08:01:52PM +0530, Vineet Gupta wrote:
> > Same thing happens in the the kernel. A statfs structure is always
> > exported whether you can support the
> > 32-bit syscall or not.
>
> Well for the ABI we are targeting there's just the 64bit interface left
> (if we focus on just stat/statfs for now) .. unless I'm missing something.
>
> Now a crazy idea - for the arches under consideration (i.e no backward
> compatibility baggage) can we simply typedef statfs/stat structures to
> statfs64 and stat64 respectively. This is extending Rich's suggestion.
Not quite. If your off_t is 32-bit, you can't provide a stat structure
where the st_size member is not off_t but some 64-bit type. You need
to slightly redefine the structure to have a 32-bit field and another
32-bit padding field next to it when 32-bit off_t is in use.
Or, preferably, you could just have _FILE_OFFSET_BITS always be 64 on
no-legacy-syscall archs.
Rich
More information about the uClibc
mailing list