Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.unix-wizards Subject: Re: rcs problem Message-ID: <6482@umcp-cs.UUCP> Date: Tue, 10-Apr-84 05:04:00 EST Article-I.D.: umcp-cs.6482 Posted: Tue Apr 10 05:04:00 1984 Date-Received: Wed, 11-Apr-84 05:43:46 EST References: <971@qubix.UUCP> Organization: Univ. of Maryland, Computer Science Dept. Lines: 20 "_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@umcp-cs ARPA: chris.umcp-cs@CSNet-Relay