Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.wizards Subject: Re: stdio broken in SysV? Message-ID: <12226@smoke.BRL.MIL> Date: 24 Feb 90 18:12:20 GMT References: <2010@sauron.Columbia.NCR.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <2010@sauron.Columbia.NCR.COM> wescott@micky.columbia.ncr.com (Mike Wescott) writes: -Which is broken? The program that does: - fpin = fdopen(fd,"r"); - fpot = fdopen(fd,"w"); -Or the stdio that blows up in memcpy() called from doprnt() called by -fprintf() in the same program? It's hard to say. I don't think it's reasonable for an application to attempt such a feat, but on the other hand STDIO should behave sensibly anyway. -BTW the "implicit assumption" mentioned above is due to the fact that -the array _bufendtab[] is indexed by fp->_file rather than by fp-_iob -or built into the FILE structure itself. I agree that this is a design error that should be fixed.