svn commit: r290110 - in head: include lib/libc/stdio

John Baldwin jhb at freebsd.org
Wed Oct 28 21:58:55 UTC 2015


On Wednesday, October 28, 2015 08:52:15 AM Xin Li wrote:
> 
> On 10/28/15 07:40, Andrey A. Chernov wrote:
> > Author: ache
> > Date: Wed Oct 28 14:40:02 2015
> > New Revision: 290110
> > URL: https://svnweb.freebsd.org/changeset/base/290110
> > 
> > Log:
> >   Add _flags2 per jhb@ suggestion since no room left in _flags.
> >   Rewrite O_APPEND flag checking using new __S2OAP flag.
> 
> Is this ABI-safe?  (I was somewhat surprised that struct FILE is not
> opaque, which seems to be unavoidable because some methods are
> traditionally macros that have direct access to the members; the
> addition is done in the end of the structure so it looks like the change
> is safe).

I believe that adding new fields should be safe.  Allocating a static
FILE object in an application hasn't been supported in a long while.

However, we cannot make FILE fully opaque.  (I tried and had to revert
it.)  I have thought about using an #ifdef to hide all of the members
not marked for ABI compat though so that they are otherwise only
accessible to libc's implementation.  This is probably worth doing to
at least prevent accidental use of the internal fields.

-- 
John Baldwin


More information about the svn-src-all mailing list