Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site celerity.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!ittatc!dcdwest!sdcsvax!celerity!barto From: barto@celerity.UUCP (David Barto) Newsgroups: net.bugs.4bsd Subject: Re: Bug in isatty (errno setting/clearing) Message-ID: <304@celerity.UUCP> Date: Thu, 1-Aug-85 11:17:47 EDT Article-I.D.: celerity.304 Posted: Thu Aug 1 11:17:47 1985 Date-Received: Sat, 3-Aug-85 21:45:09 EDT References: <965@sdcsvax.UUCP> <2200011@uiucuxc> Reply-To: barto@celerity.UUCP (David Barto) Organization: Celerity Computing, San Diego, Ca. Lines: 32 In article <2200011@uiucuxc> hamilton@uiucuxc.Uiuc.ARPA writes: > >> MY 4.2bsd manual says: >> ... An >> error number is also made available in the external variable >> _errno_, which is not cleared on successful calls. Thus _errno_ >> should be tested only after an error has occurred. >> > notice that that quote is from intro(2), while the functions >causing all this ruckus are from section 3, and intro(3) mentions >errno only in the context of math functions. i don't want to dig >out my V6 manuals, but i'm fairly sure errno used to be exclusively >maintained by the system call interface functions. > wayne ({decvax,ucbvax}!pur-ee!uiucdcs!uiucuxc!)hamilton I got out MY V6 manuals and the following is a quote from the getc(III) DIAGNOSTICS c-bit is set on EOF or error; from C, negative return indicates EOF. Moreover, 'errno' is set by this routine just as it is for a system call (see introduction (II)). Also putc, putw, fcreat, fflush, all happen to munge errno, as necessary. So in V6, we have errno munged by the library routines in section 3. -- David Barto, Celerity Computing, San Diego Ca, (619) 271-9940 decvax-\ bang-\ ARPA: celerity!barto@sdcsvax.ARPA ucbvax--\ akgua-\ ihnp4----\-sdcsvax-\-celerity!barto "There are no moral lessons in nature" - Darwin