stdio broken in SysV?

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Feb 25 05:12:20 AEST 1990


In article <2010 at sauron.Columbia.NCR.COM> wescott at 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.



More information about the Comp.unix.wizards mailing list