Path: utzoo!utgpu!attcan!uunet!samsung!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!mjs From: mjs@hpfcso.HP.COM (Marc Sabatella) Newsgroups: comp.sys.hp Subject: Re: Extraneous error code under 3.1? Message-ID: <7370040@hpfcso.HP.COM> Date: 19 Nov 89 20:31:39 GMT References: Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 17 >When we run the following code in either form (with the fgets or fscanf), >the first fgets/fscanf call returns an error code of 25 . If that is >cleared, following calls do not touch errno . Would someone else please >try this and report back your results? None of this is surprising; none of the library functions in your program are supposed to set errno to any reasonable value. The system calls which are used internally often do use and modify it, however. In general, if the man page for a function doesn't say it puts an error code into "errno", assume it trashes it; and furthermore, even for those functions which do return codes in "errno", the value is only valid only if the actual function return indictaes that an error occurred (generally, when a system call returns -1). -------------- Marc Sabatella HP Colorado Language Lab marc%hpfcrt@hplabs.hp.com