Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2008 00:27:05 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        arch@freebsd.org, Garrett Wollman <wollman@hergotha.csail.mit.edu>
Subject:   Re: Cleaning up FILE in stdio..
Message-ID:  <200802270027.05426.jhb@freebsd.org>
In-Reply-To: <Pine.GSO.4.64.0802262351060.11586@sea.ntplx.net>
References:  <200802262251.m1QMp7bV021709@hergotha.csail.mit.edu> <Pine.GSO.4.64.0802262351060.11586@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 26 February 2008 11:58:55 pm Daniel Eischen wrote:
> On Tue, 26 Feb 2008, Garrett Wollman wrote:
> 
> > In article <200802261524.30384.jhb@FreeBSD.org> you write:
> >
> >> This is assuming that the contents and layout of FILE are not a
> >> public ABI (i.e. we malloc the things internally and consumers should
> >> just treat the pointer value as a cookie and not grub around in the
> >> internals).
> >
> > Most interpreted languages grub around in the internals, as
> > (historically) do a number of <stdio.h> macros.  Historically Emacs
> > did so as well (I suppose you can call it an interpreted language).
> 
> Yech.  I also forgot about the macros in <stdio.h>, like __sfeof()
> and friends.
> 
> >> Comments?
> >
> > 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.

You have to worry about other libraries (say ncurses) that use fopen@1.0 and 
then return that FILE * to a user app that calls fclose (but the user app 
will call fclose@1.1 and it blows up).  Hence in my other e-mail where I said 
all the stdio routines would have to detect the two different versions and 
handle them.  Gross.

> I'd like us to say that the innards of FILE are not part of our
> ABI, but we would still have to do something to keep at least
> enough of the ABI for any macros.

The problem is that _file is used by fileno() via __sfile() and that's the one 
I want to fix.  The sFILEX stuff is ok as none of it is exposed, but not 
fixing __file.

-- 
John Baldwin



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