Path: utzoo!mnetor!uunet!husc6!hao!boulder!sunybcs!rutgers!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Michael Meissner) Newsgroups: comp.lang.c Subject: Re: closing stdout Message-ID: <468@xyzzy.UUCP> Date: 17 Dec 87 00:00:34 GMT References: <442@cresswell.quintus.UUCP> <1115@jenny.cl.cam.ac.uk> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 13 Keywords: Yes it IS a buggy library In article <1115@jenny.cl.cam.ac.uk> am@cl.cam.ac.uk (Alan Mycroft) writes: | Merely separate the _cnt field | of struct FILE into a _icnt and an _ocnt, change getc/putc to use _icnt/_ocnt. | Fix _filbuf/_flsbuf to use the right one, and to whinge when _icnt/_ocnt | goes -ve when you expect the other one to. | This for free also enables the library to police the "fflush/fseek between | change of direction for I/O" restriction and avoids chaos there. While this does solve the problem, I have found that there quite a few bad mannered programs that go rifling through things like _cnt, _ptr, _base, and _flag within the "standard" UNIX FILE stream. Sigh....... -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner Arpa/Csnet: meissner@dg-rtp.DG.COM