Subject: | |
From: | |
Reply To: | |
Date: | Mon, 19 Apr 1999 15:48:03 -0600 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
For those working with HP C/iX and have trouble understanding
why output from stdout and stderr like with printf ( ... and fprintf (
stderr, ...
gets mangled together, or comes in reverse order or
different when ran in batch,
Here is what I have found.
In session mode, C opens
stdin as line buffered
stdout as line buffered
stderr as unbuffered
In job mode
stdin as full buffered
stdout as full buffered
stderr as unbuffered
Full buffered means do not output until the buffer is filled
Line buffered means output when a newline '\n' char is processed or when the
buffer is filled
unbuffered means output now.
I was expecting Line buffering on stdout if job mode.
To correct this ( assuming you think this is a problem as I do ), you need
to add
setvbuf ( stdout, NULL, _IOLBF, 0 );
Please lookup the call in your HP C/iX Library reference manual !
+=====================================
Keven Miller KC7LYD ICQ 5721825
[log in to unmask] (Salt Lake City, Utah, USA)
+=====================================
|
|
|