This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
- From: Andreas Schwab <schwab at suse dot de>
- To: Alistair Francis <alistair dot francis at wdc dot com>
- Cc: libc-alpha at sourceware dot org, joseph at codesourcery dot com, macro at wdc dot com, alistair23 at gmail dot com
- Date: Tue, 17 Sep 2019 09:58:34 +0200
- Subject: Re: [PATCH 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
- References: <20190916221700.22039-1-alistair.francis@wdc.com>
On Sep 16 2019, Alistair Francis <alistair.francis@wdc.com> wrote:
> @@ -40,7 +40,10 @@
> /* Versions of the `xmknod' interface. */
> #define _MKNOD_VER_LINUX 0
>
> -#if defined __USE_FILE_OFFSET64
> +#if defined(__USE_FILE_OFFSET64) || __INO_T_MATCHES_INO64_T == 1
> +# if __INO_T_MATCHES_INO64_T == 1 && __OFF_T_MATCHES_OFF64_T != 1
Why are you using ==/!= 1 instead of !=/== 0?
> +# error "ino_t and off_t must both be the same type"
> +# endif
> # define __field64(type, type64, name) type64 name
> #elif __WORDSIZE == 64
> # define __field64(type, type64, name) type name
> diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
> index 45efcd8fd34..3c21da501b2 100644
> --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
> +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
> @@ -36,12 +36,16 @@ static inline off_t lseek_overflow (loff_t res)
>
> static inline int stat_overflow (struct stat *buf)
> {
> +#if defined (__INO_T_MATCHES_INO64_T)
Shouldn't that be #if __INO_T_MATCHES_INO64_T?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."