Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Feb 2016 23:05:01 +0100
From: Joakim Sindholt <opensource@...sha.com>
To: musl@...ts.openwall.com
Subject: Re: Enforcing expected ordering of operations on stdout,
 stdin, and stderr

On Wed, 2016-02-10 at 16:49 -0500, Max Ruttenberg wrote:
> All,
> 
> 
> I guess my question is more easily asked through an example. If I have
> code that makes a call to puts and then a call to getchar, what
> mechanism enforces that stdout gets flushed before blocking for stdin?
> Is there a such a mechanism? My gut says yes but I haven't been able
> to pinpoint it. 
> 
> 
> Thanks,
> Max

fflush(stdout);

This is more of a basic C thing than a libc ml thing. You should
consider picking up a copy of The C Programming Language by Kernighan
and Ritchie. It will explain all of this.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.