Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title printf() printing before term_printf()
Ref. No. QNX.000009320
Category(ies) Utilities, Development
Issue We're writing a QNX4 application that uses both printf() and term_printf() in its user interface modules. Problem is, even when some term_printf() are called before the printf(), the output of the printf() appears first!  We've tried putting a sleep() in before the printf() call, but to no avail.


Solution The term...() functions are all buffered. Thus to siege output immediately from a term_printf(), set the TERM_FLUSH flag or do a separate term_flush() call. For example:

term_printf(11,5,TERM_NORMALITERM_FLUSH,"Press a key to continue");

x09OR

term_printf(11,5,TERM_NORMAL."Go ahead,");
term_printf(11,5,TERM_NORMAL,"Press a key to continue");
term_flush();