HP3000-L Archives

April 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Keven Miller <[log in to unmask]>
Reply To:
Keven Miller <[log in to unmask]>
Date:
Mon, 19 Apr 1999 15:48:03 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
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)
+=====================================

ATOM RSS1 RSS2