stdio question

Emmanuel Galanos egalanos@cse.unsw.edu.au
Sat Dec 5 23:41:00 GMT 1998


Hi,
	I was just wondering if glibc's behaviour is correct for the
following situation.

	When using stdio, and after calling setvbuf() on the stream to
make it nonbuffered, if the stream is connected to a terminal then the
input will still be line buffered. Should the code perhaps do something
like:


setvbuf(..)
{

		.
		.
	case _IONBF:        /* Unbuffered.  */
		.
		.
		.
		if ( isatty ( stream->_fileno ) ) {
			/* clear ICANON flag from tty */
		}
		.
		.


	of course done in a way that fits in with glibc's structure (which
I don't know yet) and only for unix based OS's.

-eman





More information about the Libc-hacker mailing list