cvs commit: src/lib/libc/stdio _flock_stub.c local.h

Tim Robbins tjr at freebsd.org
Mon Mar 8 20:35:58 PST 2004


On Tue, Mar 09, 2004 at 03:05:36PM +1100, John Birrell wrote:

> On Tue, Mar 09, 2004 at 02:55:32PM +1100, Tim Robbins wrote:
> > My concern here is that we are slowing down critical paths for the
> > sake of broken applications that grope around inside FILEs. Why do
> > we need to support this? Which applications require it, and why?
> 
> I'm not sure that I agree that applications are 'broken' when they
> use things that are defined in the header file along with the FILE
> structure itself.

They are. The structure is an implementation detail, and the layout
or size could change between releases, or it's definition could be
moved into a libc-private header entirely.

> As I said in my previous mail, if you want to improve performance,
> then remove the locking code from libc completely in the single-threaded
> case. That will have more benefit than checking a NULL pointer that
> has to be resolved anyway in order to access the fields it points
> to.

Threads are useful. Supporting some phantom application you won't name
that initializes its own FILE structures instead of using the correct
interfaces is not terribly useful.

> I think you're arguing about just a few instructions on i386.

I'm arguing over a principle, and trying to stop FreeBSD getting locked
into a certain arrangement of stdio internals for the sake of broken
applications.


Tim


More information about the cvs-src mailing list