This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc calls more write() than necessary


Mike Frysinger <vapier@gentoo.org> writes:

> On Sunday 21 January 2007 16:03, Matthieu Lemerre wrote:
>> Maybe I wasn't clear enough... My concern is the following one: when a
>> stream is line buffered, I think that the flush need to be done only
>> at the LAST '\n', not at each one of them.  That way, you flush less,
>> you syscall less, and the program run faster.
>
> that is not how the standard works
>
> line buffered means line buffered ... it doesnt mean buffer some lines but not 
> others
> -mike

OK then, if the standard precisely defines that flushes must be done
at all lines.  I don't have it here, so I can't tell.

Note however, that you get the same observed behaviour when you
flushes only the last '\n'.

Matthieu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]