The stdout always becomes line buffered mode.

Kazuhiro Fujieda fujieda@jaist.ac.jp
Thu Apr 26 13:17:00 GMT 2001


The latest newlib always sets the stdout to the line buffered
mode against the standard quoted below.

  ISO/IEC 9899:1999, Second Edition 1999-12-01, p.266
    As initially opened, the standard error stream is not fully buffered;
    the standard input and standard output streams are fully buffered if
    and only if the stream can be determined not to refer to an interective
    device.

The following patch can correct it.

2001-04-27  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>

	* libc/stdio/findfp.c (__sinit): Don't set stdout to line buffered
	mode here, because it is properly set by __smakebuf in makebuf.c.

Index: findfp.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/findfp.c,v
retrieving revision 1.3
diff -u -p -r1.3 findfp.c
--- findfp.c	2000/05/23 23:51:54	1.3
+++ findfp.c	2001/04/26 19:21:53
@@ -152,7 +152,7 @@ __sinit (s)
   s->__sdidinit = 1;
 
   std (s->__sf + 0, __SRD, 0, s);
-  std (s->__sf + 1, __SWR | __SLBF, 1, s);
+  std (s->__sf + 1, __SWR, 1, s);
   std (s->__sf + 2, __SWR | __SNBF, 2, s);
 
   s->__sglue._next = NULL;

____
  | AIST      Kazuhiro Fujieda <fujieda@jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology



More information about the Newlib mailing list