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
On Fri, Oct 18, 2019 at 8:08 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> 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.)
Ok, I have added a file: sysdeps/unix/sysv/linux/generic/stat-check.c
>
> 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.
Done!
Alistair
>
> --
> Joseph S. Myers
> joseph@codesourcery.com