Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2008 00:31:59 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-arch@freebsd.org
Cc:        deischen@freebsd.org, Garrett Wollman <wollman@hergotha.csail.mit.edu>
Subject:   Re: Cleaning up FILE in stdio..
Message-ID:  <200802270031.59797.jhb@freebsd.org>
In-Reply-To: <200802270514.m1R5ExDe024046@hergotha.csail.mit.edu>
References:  <200802262251.m1QMp7bV021709@hergotha.csail.mit.edu> <200802270514.m1R5ExDe024046@hergotha.csail.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 27 February 2008 12:14:59 am Garrett Wollman wrote:
> In article <Pine.GSO.4.64.0802262351060.11586@sea.ntplx.net>,
> Daniel Eischen <deischen@freebsd.org> writes:
> >> [I wrote:]
> >> I think you have the right idea but this will break the ABI in a way
> >> that can't be fudged with symbol versioning.
> >
> >Well, you can if you add compat symbols for all functions with FILE
> >as an argument.
> 
> In every library, including hundreds of third-party libraries that
> pass FILE * arguments?  I don't think so.
> 
> What would work, although it would be extra pain, would be to extend
> the structure.  It would be necessary to keep compatibility members of
> the structure, in their old locations, and update them to reflect
> state changes appropriately.  If the only thing that will change is
> the width of _file, then that's probably a workable approach, since it
> doesn't break anything that wasn't already broken in the presence of
> FD 65536 anyway.  Applications aren't permitted to store objects of
> type FILE, only FILE *, so this should be safe.

Actually FD 32768.  32768 gets sign extended when the short is promoted to an 
int.  I guess we could add a _nfile that is an int, and try to keep _file up 
to date for older apps.  Newer apps would just always use _nfile.  (Or 
better, rename _file to _ofile and make the new one _file but at new 
location).  I'll work on that next then.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802270031.59797.jhb>