[PATCH] prevent retries on fclose/fflush after write errors

u-uclibc-qs50 at aetey.se u-uclibc-qs50 at aetey.se
Tue Mar 13 20:56:13 UTC 2012


On Tue, Mar 13, 2012 at 04:24:33PM -0400, Mike Frysinger wrote:
> > It should definitely not be added near the
> > beginning of the structure, only past elements that could be part of
> > the macro ABI.
> 
> that would help only if the uClibc code itself had versioned functions which 
> handled the growing struct. 

Curious, why wouldn't this work without versioned functions?

FILE structures are expected to be allocated by the library and
used by 1. the library and 2. the macros. If we just add extra items
at the end, neither the new library code would be confused (it knows about
the new size and contents), nor the old application code would be confused
(the macros use[d] the offsets which did not change, the calls to
the functions pass pointers not structures).

Of course this generally only works if the macros are not being changed.

> if you're attempting to support code that 
> allocated sizeof(FILE) memory (which is dumb), then location in the struct 
> wouldn't matter.

I don't think keeping the size of FILE constant is practically important,
even though I mentioned this as an incompatibility.

Anyway, everyone now seems to agree that the proposed patch breaks the ABI :)

> -mike

Regards,
Rune



More information about the uClibc mailing list