Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!cbosgd!cbdkc1!desoto!cord!hudson!ihnp1!ihnp4!zehntel!dual!amd!pesnta!hplabs!hao!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn) Newsgroups: net.unix-wizards Subject: Re: Re: 4.2bsd eof flag in stdio Message-ID: <6342@brl-tgr.ARPA> Date: Tue, 11-Dec-84 00:23:08 EST Article-I.D.: brl-tgr.6342 Posted: Tue Dec 11 00:23:08 1984 Date-Received: Fri, 7-Dec-84 05:39:59 EST References: <126@ISM780B.UUCP> <1825@sun.uucp> Organization: Ballistic Research Lab Lines: 12 > DIAGNOSTICS > Fread and fwrite return 0 upon end of file or error. Yes, it used to say that. It failed to clarify what would happen on a "short read". Returning 0 in such a case is absolutely incompatible with the DESIGN of fread(): that you tell it how many items you want and it returns the number you got. Clearly the above portion of the manual was not well thought out, since it led to this discussion. AT&T has clarified this (and many similar oversights, ambiguities, and confusion) in the manual; and in this particular case I think they did it right (since it makes the function design make more sense than the other interpretation).