Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!mit-eddie!think!harvard!seismo!umcp-cs!chris
From: chris@umcp-cs.UUCP (Chris Torek)
Newsgroups: net.unix
Subject: Re: an inquiry about 4.2 stdio.h
Message-ID: <513@umcp-cs.UUCP>
Date: Fri, 28-Jun-85 05:55:49 EDT
Article-I.D.: umcp-cs.513
Posted: Fri Jun 28 05:55:49 1985
Date-Received: Tue, 2-Jul-85 06:05:52 EDT
References: <1902@ukma.UUCP> <2353@sun.uucp>
Organization: U of Maryland, Computer Science Dept., College Park, MD
Lines: 33

> "IOSTRG" tells [stdio] not to do something dumb with that stream,
> like trying to do real live I/O into or from the buffer.

I probably shouldn't be putting more verbiage onto the net, but I
can't let this go by without comment.

One would *think* that this is what _IOSTRG does.  In fact _IOSTRG
has no effect whatsoever.  If you run the following under 4.1 or 4.2BSD,
it will write to file descriptor 0:

	#include 

	main() {
		struct _iobuf io;
		char place[3];

		io._cnt = 3;
		io._base = io._ptr = place;
		io._flag = _IOWRT|_IOSTRG;
		_doprnt("testing...", 0, &io);
		exit(0);
	}

(The io._base initialization is just to make it something other
than NULL, since it's in zero filled stack space.)

To make it work properly, you have to (get this) take away _IOWRT.
Properly, by the way, means it should put ``tes'' into place[]
and then return a failure indication.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland