Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.xenix Subject: Re: ENOTTY sometimes spurious Message-ID: <6309@mimsy.UUCP> Date: Fri, 17-Apr-87 00:04:19 EST Article-I.D.: mimsy.6309 Posted: Fri Apr 17 00:04:19 1987 Date-Received: Sun, 19-Apr-87 09:52:35 EST References: <143@sds.UUCP> <415@psu-cs.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 In article <415@psu-cs.UUCP> curnutt@psu-cs.UUCP (Bryan Curnutt) writes: >We're using SCO Xenix on a Sperry IT, and I've found that fprintf(), >when used with text files, will always set errno to ENOTTY and return >a non-zero value. What makes this more interesting is that the >fprintf() DOES WORK. I called SCO about this, and they told me >to ignore it. They are right, for this is not a bug. In System V, fprintf returns the number of characters written, `or a negative value if an output error was encountered'. C library (manual section 3) routines, unless otherwise specified, do not promise anything about `errno'. It is not correct to use errno even if fprintf returns an error indication (although it may be better than nothing). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu