This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Make _FILE_OFFSET_BITS=64 default.
- From: Rich Felker <dalias at aerifal dot cx>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: OndÅej BÃlka <neleai at seznam dot cz>, Paul Eggert <eggert at cs dot ucla dot edu>, Denis Obrezkov <reprofy at etersoft dot ru>, libc-alpha at sourceware dot org
- Date: Wed, 5 Mar 2014 14:12:25 -0500
- Subject: Re: [RFC] Make _FILE_OFFSET_BITS=64 default.
- Authentication-results: sourceware.org; auth=none
- References: <1393521776-1102-1-git-send-email-reprofy at etersoft dot ru> <530F79C1 dot 2040508 at cs dot ucla dot edu> <20140305091331 dot GA6031 at domone dot podge> <5316FF9F dot 1060301 at redhat dot com> <20140305180704 dot GM184 at brightrain dot aerifal dot cx> <53176EEE dot 8070500 at redhat dot com>
On Wed, Mar 05, 2014 at 07:37:34PM +0100, Florian Weimer wrote:
> On 03/05/2014 07:07 PM, Rich Felker wrote:
> >On Wed, Mar 05, 2014 at 11:42:39AM +0100, Florian Weimer wrote:
> >>On 03/05/2014 10:13 AM, OndÅej BÃlka wrote:
> >>
> >>>Changing default would be better. I dig while how to do it and can not
> >>>find a nonugly solution. How should we do this?
> >>
> >>Isn't this a global ABI change? I don't think we can do this.
> >
> >No, it's just a change in the default exposed features. There's no ABI
> >issue because programs built with _FILE_OFFSET_BITS=64 access
> >different symbols (the nasty namespace-violating ones with the 64
> >suffix) rather than the ordinary ones.
>
> Doesn't it changes the definition of off_t and ino_t as well? While
> these aren't supposed to be used in public header files, such a
> change seems fairly risky to me.
Yes it does, but at the same time it switches which functions you are
calling to the versions that expect 64-bit inodes and offsets. You
can't end up in a situation where you're calling the 32-bit functions
but off_t is 64-bit. What can happen is that you have two translation
units of the application (e.g. one from the main program and one from
a third-party library) that are using mismatching definitions of
off_t, and this is very problematic, but it's ALREADY happening now
due to the poor choice of defaults. On most properly built real-world
distros, the vast majority of packages are built with
-D_FILE_OFFSET_BITS=64 because failure to do so results in all kinds
of breakage (not just stat; failure to open large files too). But a
few package maintainers forget it, and then you have bugs. Just making
the correct setting the default would largely make the problem go
away.
Rich