Cleaning up FILE in stdio..

Daniel Eischen deischen at freebsd.org
Wed Feb 27 15:33:56 UTC 2008


On Wed, 27 Feb 2008, David Schultz wrote:

> On Tue, Feb 26, 2008, John Baldwin 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.
> [...]
>> However, I can't fix the fact that our stdio can't handle fd's > SHRT_MAX
>> (again, glibc handles this just fine) w/o making a royal mess.  We could
>> create a new versioned FILE struct (so long as we can recognize the existing
>> FILE struct somehow) and have new fopen()/fdopen()/freopen() symbols that
>> return the new struct but then all the stdio routines would have to check to
>> see if the structure was an old structure explicitly and handle it
>> appropriately if so.  Rather gross.
>
> Symbol versioning also doesn't help the case where a FILE * gets
> passed from an app that's using the new symbol to another library
> that's using the old symbol, or vise versa. If you do wind up
> breaking the ABI again, maybe it's worth it to add an explicit
> version number in the FILE struct itself, so we never have to
> worry about this again.

If we are doing anything about this and modifying FILE, perhaps
we should also think about hiding all the innards of FILE, except
for the few fields that are required for the stdio macros.

-- 
DE


More information about the freebsd-arch mailing list