Re: [[uClinux-dev] Problems with printf]

From: David McCullough (davidm@lineo.com)
Date: Mon Nov 27 2000 - 02:25:35 EST


Jivin Jesu Francois Michelangelo Serafica lays it down ...
> Greetings,
>   Weve encountered the same problem for printf(" ....."); in general on
> uClinux on 5206eC3. I have no authoritative answer for the reason, but
> fflush()-ing after printf calls seems to do the trick.

Apart from some bugs with the buffering (posted earlier) printf outputs
to "stdout",  this means the normal stdio buffering applies.  Checkout
the manpage for setbuf,  it explains the buffering modes.

In normal operation stderr is unbuffered and stdin/stdout are buffered.

Using printf as the example,  no characters are displayed until:

	1.	A new line ('\n') is output; or
	2.	The buffer is filled; or
	3.	the user calls fflush to force output; or
	4.	the user calls fgetc or some other stdio input routine.

You can change the buffering characteristics of the FILE with setbuf.
If this doesn't explain what you are seeing let me know,  from the few
quicks tests I did it seemed to work as listed above,

Cheers,
Davidm

-- 
David McCullough:  Ph: +61 7 3279 1822  Lineo (The Embedded Linux Company)
davidm@lineo.com   Fx: +61 7 3279 1820  PO Box 925, Kenmore QLD 4069, Australia
This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/


This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:19 EDT