This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Coupling of stdin and stdout
- From: "Shaun Jackman" <sjackman at gmail dot com>
- To: newlib at sources dot redhat dot com
- Date: Wed, 10 May 2006 11:06:33 -0600
- Subject: Re: Coupling of stdin and stdout
- References: <7f45d9390605101002r3d5ec683iaf26fe6fc71fa0f7@mail.gmail.com>
- Reply-to: "Shaun Jackman" <sjackman at gmail dot com>
On 5/10/06, Shaun Jackman <sjackman@gmail.com> wrote:
What is the mechanism whereby reading from stdin causes stdout to be flushed?
Cheers,
Shaun
Ah, found it.
libc/stdio/refill.c (__srefill):
/*
* Before reading from a line buffered or unbuffered file,
* flush all line buffered output files, per the ANSI C
* standard.
*/
if (fp->_flags & (__SLBF | __SNBF))
_CAST_VOID _fwalk (_GLOBAL_REENT, lflush);