This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Fix struct stat [__USE_FILE_OFFSET64] insysdeps/unix/sysv/linux/bits/stat.h
- From: Andreas Schwab <schwab at suse dot de>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: libc-alpha at sources dot redhat dot com, dev-etrax at pulsar dot homelinux dot net
- Date: Tue, 03 Jun 2003 16:47:59 +0200
- Subject: Re: PATCH: Fix struct stat [__USE_FILE_OFFSET64] insysdeps/unix/sysv/linux/bits/stat.h
- References: <200306031204.h53C4MGD020114@ignucius.se.axis.com>
Hans-Peter Nilsson <hans-peter.nilsson@axis.com> writes:
|> > From: Andreas Schwab <schwab@suse.de>
|> > Date: Tue, 03 Jun 2003 13:55:42 +0200
|>
|> > Hans-Peter Nilsson <hans-peter.nilsson@axis.com> writes:
|> > |> This bug is visible for programs compiled with
|> > |> -D_FILE_OFFSET_BITS=64 on platforms where the ABI says there is
|> > |> no alignment-padding between structure elements. AFAIK only
|> > |> cris-axis-linux-gnu matches that description. The bug causes
|> > |> struct stat and struct stat64 to have different layout.
|> >
|> > How about using your own bits/stat.h? m68k-linux has a similar problem
|> > and does that.
|>
|> If it's indeed due to the exakt same problem, then that solution
|> is faulty.
On m68k there are further differences due to byte order.
|> > 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. 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.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."