Not a typewriter

Michael Meissner meissner at dg_rtp.UUCP
Tue Jun 17 01:25:49 AEST 1986


In article <542 at codas.ATT.UUCP> mikel at codas.ATT.UUCP (Mikel Manitius) writes:
>> What does the sys_errlist message 'Not a typewriter' *really* mean??
>
>Errno 25 is usually generated when a program tries to execute an
>ioctl command that expects the file descriptor to be a terminal.
>(ie: you can't set the baud rate on a file).
>
>However I have also noticed that some aplications aren't very
>carefull when they use errno. For example, Informix may give
>you this message if it cannot open a database file because it
>does not exist!

    This particular error code tends to be set in errno, the first time you
use a stdio file that is not a terminal.  That is because the runtime library
wants to know if the file is associated with a terminal (so that it can be
unbuffered output in BSD or line buffered in SV.2).  Hence the library does
a isatty, which does an ioctl, and which fails, giving the error.  If an error
occurs on ioctl, isatty returns 0 instead of 1, and the library sets up to
fully buffer the file.

	Michael Meissner
	Data General Corporation
	...{ decvax, ihnp4, ucbvax }!mcnc!rti-sel!dg_rtp!meissner



More information about the Comp.unix mailing list