[COMMITTED PATCH] Move tilegx, tilepro, and linux-generic from ports to libc.
H.J. Lu
hjl.tools@gmail.com
Thu Mar 19 16:44:00 GMT 2015
On Thu, Mar 19, 2015 at 9:31 AM, Chris Metcalf <cmetcalf@ezchip.com> wrote:
> On 03/18/2015 07:59 AM, H.J. Lu wrote:
>>
>> Any particular reason to add sysdeps/unix/sysv/linux/generic/bits/statfs.h
>> when there is sysdeps/unix/sysv/linux/bits/statfs.h already? Why can't it be
>> used?
>
>
> The distinction lies with the the fields defined by __field64 in the
> "generic" version. For the case without __USE_FILE_OFFSET64, but when ILP32
> mode is involved, the base linux version uses plain __fsblkcnt_t, i.e.
> unsigned long, so just 32 bits. However, it needs to be a 64-bit field,
> where either the first or second 32-bit subfield is padding depending on
> endianness, and the field value is the other 32-bit subfield. We would need
> to adopt the __field64 scheme for the base version in some way that allowed
> platforms to turn it on as needed (depending on whether statfs is filled
> with a statfs64 syscall or a plain 32-bit statfs syscall on older, non
> asm-generic 32-bit kernels). This is doable but fiddly to get exactly
> right.
>
> Another difference I see is easy to work around. The "generic" linux
> version uses __SWORD_TYPE where the base version uses __fsword_t (changed by
> hjl in 2012). If the generic platforms (tile, aarch64, nios2) switched,
> this would be OK since the types are the same on those platforms. (Only
> alpha and x32 define them differently.)
There are
sysdeps/unix/sysv/linux/mips/bits/statfs.h
sysdeps/unix/sysv/linux/alpha/bits/statfs.h
sysdeps/unix/sysv/linux/bits/statfs.h
sysdeps/unix/sysv/linux/s390/bits/statfs.h
If sysdeps/unix/sysv/linux/bits/statfs.h can't be used for
a Linux platform, it should define its own statfs.h, like
alpha, mips and s390. Having both
sysdeps/unix/sysv/linux/generic/bits/statfs.h
and
sysdeps/unix/sysv/linux/bits/statfs.h
is very strange.
H.J.
--
H.J.
More information about the Libc-alpha
mailing list