[comp.os.minix] 1.3 getc and unbuffered files

tholm@uvicctr.UUCP (Terrence W. Holm) (07/13/88)

There is a problem with unbuffered files in MINIX 1.3 getc(),
try the following,

-------------------------------------------------------
#include <stdio.h>

main() {
  int c;
  FILE *f = fopen( ".profile", "r" );

  setbuf( f, NULL );

  while( (c = getc(f)) != EOF )
    putchar( c );
}
-------------------------------------------------------