Cleaning up FILE in stdio..
John Baldwin
jhb at freebsd.org
Wed Feb 27 05:50:13 UTC 2008
On Wednesday 27 February 2008 12:14:59 am Garrett Wollman wrote:
> In article <Pine.GSO.4.64.0802262351060.11586 at sea.ntplx.net>,
> Daniel Eischen <deischen at 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
More information about the freebsd-arch
mailing list