rcs problem

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Tue Apr 10 20:04:00 AEST 1984


"_sobuf" and "_sibuf" are (the) two pre-allocated buffer areas that
the Berkeley stdio routines attach to stdin and stdout.  In order
to guarantee full (rather than line) buffering, the code

	extern char _sobuf[];
	setbuf (stout, _sobuf);

does the trick.  Of course it's not portable; nobody said stdio has
to have preallocated buffers named "_sobuf" and "_sibuf".

I'm really not sure why they did that, rather than just malloc()ing
the buffers the way the _iob[3] to _iob[NOFILE-1] are done ...
performance maybe.

[While I'm thinking of it:  Why, oh why, didn't they make "setbuf"
able to set line buffering???]
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris.umcp-cs at CSNet-Relay



More information about the Comp.unix.wizards mailing list