This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Alistair Francis <alistair dot francis at wdc dot com>
- Cc: <libc-alpha at sourceware dot org>, <alistair23 at gmaill dot com>
- Date: Fri, 18 Oct 2019 15:08:29 +0000
- Subject: Re: [PATCH v4 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
- Ironport-sdr: KXQ7TtIpUnhNHdT1VYdbpsnVeZQFBDrNIrhqMUy74NzrmBNU860TLuQPG0P/b58QNzwk9HH7Lb kWlvJURyZQMeC512QZcl5GUdiVo0NTUvDYdU5Rkr6/vZ3Z/84TsG0+nO8OZXWYRCRvIA+lbDzE 7E22eihgtbvqqTg1YOi0WfVG7kLQaIJn/4andEStVC8DXVM057XhYQ3V7+/r4OpmCbuJG8jatM kVFxTrZjSyQxfbDPtfl+rl+ecXynTC4wyKGoPZO16ddGJ3uTtMjFhpqG1Gh7cioPKIV9+W6lP8 GTw=
- Ironport-sdr: E4nrlmZM3vBijTJv0X8+D+2twCK5cYw0Ctp8MaCsErXjA37E0YWRwDwloKp/uqxmq0DFVLUNld S6ZJQ32XHOtqn+XM07zt82idnkzvlbRhvLvrUAqMGqBWBqDz045+XkXJzLVGXIWwx3XAYVm5Lz 2widCWaBkRRhyWuj+8B4zYX8PdRb/9u5Sz4YgRtdopmOdeEkXCNYskvgt/KhgdHXfxJ7/HsfTn g6u4Xt3AG2+RS3etynVTydaJp5WxnyntOhwJmrbNkN5Uj5WF0mkmJJmGZ/13DNUBtT/1IY1mT/ Q7k=
- References: <20191016234407.4306-1-alistair.francis@wdc.com>
On Wed, 16 Oct 2019, Alistair Francis wrote:
> diff --git a/sysdeps/unix/sysv/linux/generic/xstat.c b/sysdeps/unix/sysv/linux/generic/xstat.c
> index 75ceb9bc74b..ece14fc5838 100644
> --- a/sysdeps/unix/sysv/linux/generic/xstat.c
> +++ b/sysdeps/unix/sysv/linux/generic/xstat.c
> @@ -28,6 +28,11 @@
> #include <sysdep.h>
> #include <sys/syscall.h>
>
> +#if __INO_T_MATCHES_INO64_T
> +_Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
> + "__blkcnt_t and __blkcnt64_t must match");
> +#endif
This isn't a good place for this check because this file is overridden for
wordsize-32, meaning the check is missing in the wordsize-32 case. It
needs to go somewhere used whether or not the wordsize-32 subdirectory is
in use. (You could e.g. have a source file used only for this check, that
compiles to an object file with no code.)
I think this assertion should also have a comment explaining that it's
because the layout code in bits/stat.h, and the overflow handling in
wordsize-32/overflow.h, require either all or none of the three types
concerned to have padding.
--
Joseph S. Myers
joseph@codesourcery.com