Message ID | 1414396793-9005-8-git-send-email-apinski@cavium.com |
---|---|
State | New |
Headers | show |
On 10/27/2014 3:59 AM, Andrew Pinski wrote: > --- a/sysdeps/unix/sysv/linux/generic/bits/stat.h > +++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h > @@ -42,7 +42,10 @@ > > #if defined __USE_FILE_OFFSET64 > # define __field64(type, type64, name) type64 name > -#elif __WORDSIZE == 64 > +#elif __WORDSIZE == 64 \ > + || (defined(__OFF_T_MATCHES_OFF64_T) \ > + && defined(__INO_T_MATCHES_INO64_T) \ > + && defined (__BLKCNT_T_TYPE_MATCHES_BLKCNT64_T_TYPE)) I'm somewhat skeptical of this approach. I suspect it would be better to have a single #define that says "hey, I use 64-bit kernel types for long" and then use that. If you (for some reason) had ino match ino64, but not off_t match off64_t, this header would then break for ino_t, as far as I can see. It seems better to take the simpler approach, and if some later architecture somehow wants finer granularity, let it be their problem to tease apart the different types here. This single #define would then also feed into my proposed standard __TYPESIZES_PAD32 macro, or whatever it ends up being called.
diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h index faa2800..3c92184 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/stat.h +++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h @@ -42,7 +42,10 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined(__OFF_T_MATCHES_OFF64_T) \ + && defined(__INO_T_MATCHES_INO64_T) \ + && defined (__BLKCNT_T_TYPE_MATCHES_BLKCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \ diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h index e32cf76..d3bfb50 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h +++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h @@ -34,7 +34,9 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined (__FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE) \ + && defined (__FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \