This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Fix struct stat [__USE_FILE_OFFSET64] insysdeps/unix/sysv/linux/bits/stat.h


> From: Andreas Schwab <schwab@suse.de>
> Date: Tue, 03 Jun 2003 16:47:59 +0200
> Hans-Peter Nilsson <hans-peter.nilsson@axis.com> writes:
> 
> |> > From: Andreas Schwab <schwab@suse.de>
> |> > Date: Tue, 03 Jun 2003 13:55:42 +0200
> |> >  IMHO the generic version should really be moved to i386.
> |> 
> |> But the "generic" bits/stat.h would still be buggy and as such
> |> at least confusing.  Look at bits/stat.h: compare struct stat64
> |> with struct stat *with __USE_FILE_OFFSET64 defined*.  See the
> |> difference?  There should be no difference.  That's the bug.  My
> |> patch has absolutely no effect on platforms that pad the
> |> structs; it's a generic fix.
> 
> IMHO that's the symptom of being i386 specific.

No it isn't.  It's a symptom of easily missed bug (need to parse
the #ifdef:s manually and compare to struct stat64) and/or
exposing it on a platform where it matters.  It is also
confusing; a bug that doesn't have any effect on major platforms
but obviously wrong when you know what to look for or otherwise
look at the __USE_FILE_OFFSET64 stuff (for example, when porting
glibc).

>  The real bug is that the
> padding hasn't been removed when dev_t was enlarged, but now it's too
> late to fix that.

No, it's definitely *not* "too late"!  What *exactly* makes you
think it's "too late"?  It's a bug, whose fix *does not affect
anything but the error case*.  The sole purpose of the ifdef:d
__USE_FILE_OFFSET64 stuff in struct stat is to be
layout-compatible with struct stat64.  By accident it happens to
work for all other glibc ports using the generic bits/stat.h,
apparently due to structure padding as per their ABIs.  I'm not
changing anything for ports where padding makes things work, or
anywhere when !defined __USE_FILE_OFFSET64.  Where it doesn't
work, things just *break* with __USE_FILE_OFFSET64.  There is no
compatibility issue that needs to be catered for; the fix *can*
go in without compatibility issues.  Again, keeping a buggy
bits/stat.h and having a corrected in a platform-specific
directory is confusing and wrong.

Please tell me what I'm missing, because I have trouble
understanding your reluctance to this patch.

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]