This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc calls more write() than necessary
On Sun, 21 Jan 2007 22:34:35 +0100, Matthieu Lemerre wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
...
> > 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.
http://www.opengroup.org/onlinepubs/009695399/functions/setvbuf.html
->
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_05.html#tag_02_05
When a stream is ``line buffered'', bytes are intended to be
transmitted as a block when a newline byte is encountered.
Not written as "every" but it is probably the only right interpretation.
> Note however, that you get the same observed behaviour when you
> flushes only the last '\n'.
Reader of a pipe will see the difference, it may cause regressions.
I agree the POSIX standard should have been defined more relaxed.
Jan