[comp.os.minix] flushing stdandard io streams

Leisner.Henr@xerox.com (Marty) (02/28/89)

I'm using the Minix standard I/O library on Ms/Dos and the stdout stream
doesn't automatically get flushed on a newline.

There are these perprintf macros/flags that I've never seen on other Unix/C
implementations which flush every fprintf.

But when the application software is using various combinations of
fputs/fputc, seems the output stream won't get flushed unless the program
specifically requests it.  

I've been looking at various reference materials (Harbisan & Steele, DPANS,
K&R 2nd Edition) and I've yet to stumble across anything that defines the
flushing algorithm.  Did I miss it?

I believe accepted practice is to flush when encountering a newline
character or the buffer files up.  So the perprintf stuff may be done away
with and fputc check for newline characters.


marty
ARPA:	leisner.henr@xerox.com
GV:  leisner.henr
NS:  martin leisner:wbst139:xerox
UUCP:	hplabs!arisia!leisner
 

allbery@ncoast.ORG (Brandon S. Allbery) (03/07/89)

As quoted from <9809@louie.udel.EDU> by Leisner.Henr@xerox.com (Marty):
+---------------
| I'm using the Minix standard I/O library on Ms/Dos and the stdout stream
| doesn't automatically get flushed on a newline.
+---------------

Minix is based on V7, which didn't have line buffering; that was added
(independently) to 4BSD and System V.  I suppose you could write an
implementation if you so chose....

++Brandon
-- 
Brandon S. Allbery, moderator of comp.sources.misc	     allbery@ncoast.org
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>
NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser