Not A Typewriter
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, "Not a
typewriter A typewriter is a Machine, mechanical or electromechanical machine for typing characters. Typically, a typewriter has an array of Button (control), keys, and each one causes a different single character to be produced on paper by striking an i ...
" or ENOTTY is an error code defined in the errno.h found on many
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
systems. This code is now used to indicate that an invalid
ioctl In computing, ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; ...
(input/output control) number was specified in an ioctl
system call In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
.


Details

This error originated in early
UNIX Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
. In Version 6 UNIX and earlier, I/O control was limited to serial-connected
terminal Terminal may refer to: Computing Hardware * Computer terminal, a set of primary input and output devices for a computer * Terminal (electronics), a device for joining electrical circuits together ** Battery terminal, electrical contact used to ...
devices, typically a
teletype A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
(abbreviated TTY), through the gtty and stty system calls. If an attempt was made to use these calls on a non-terminal device, the error generated was ''ENOTTY''. When the stty/gtty system calls were replaced with the more general
ioctl In computing, ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; ...
(I/O control) call, the ''ENOTTY'' error code was retained. Early computers and
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
systems used electromechanical
typewriter A typewriter is a Machine, mechanical or electromechanical machine for typing characters. Typically, a typewriter has an array of Button (control), keys, and each one causes a different single character to be produced on paper by striking an i ...
s as terminals. The abbreviation TTY, which occurs widely in modern UNIX systems, stands for "
Teletypewriter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
." For example, the original meaning of the
SIGHUP On POSIX-compliant platforms, SIGHUP ("signal hang up") is a signal sent to a process when its controlling terminal is closed. It was originally designed to notify the process of a serial line drop. SIGHUP is a symbolic constant defined in the he ...
signal A signal is both the process and the result of transmission of data over some media accomplished by embedding some variation. Signals are important in multiple subject fields including signal processing, information theory and biology. In ...
is that it ''Hangs UP'' the
phone line A telephone line or telephone circuit (or just line or circuit industrywide) is a single-user circuit on a telephone communication system. It is designed to reproduce speech of a quality that is understandable. It is the physical wire or oth ...
on the teletypewriter which uses it. The generic term "typewriter" was probably used because "Teletype" was a registered trademark of
AT&T AT&T Inc., an abbreviation for its predecessor's former name, the American Telephone and Telegraph Company, is an American multinational telecommunications holding company headquartered at Whitacre Tower in Downtown Dallas, Texas. It is the w ...
subsidiary
Teletype Corporation The Teletype Corporation, a part of AT&T Corporation, American Telephone and Telegraph Company's Western Electric manufacturing arm since 1930, came into being in 1928 when the Morkrum-Kleinschmidt Company changed its name to the name of its tra ...
and was too specific. The name "Teletype" was derived from the more general term, "teletypewriter"; using "typewriter" was a different contraction of the same original term. POSIX sidesteps this issue by describing ''ENOTTY'' as meaning "not a terminal". Because ioctl is now supported on other devices than terminals, some systems display a different message such as "Inappropriate
ioctl In computing, ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; ...
for device" instead.


Occurrence

In some cases, this message will occur even when no
ioctl In computing, ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; ...
has been issued by the program. This is due to the way the isatty() library routine works. The error code errno is only set when a system call fails. One of the first system calls made by the C standard I/O library is in an isatty() call used to determine if the program is being run interactively by a human (in which case isatty() will succeed and the library will write its output a line at a time so the user sees a regular flow of text) or as part of a pipeline (in which case it writes a block at a time for efficiency). If a library routine fails for some reason unrelated to a system call (for example, because a user name wasn't found in the password file) and a naïve programmer blindly calls the normal error reporting routine perror() on every failure, the leftover ENOTTY will result in an utterly inappropriate "Not a typewriter" (or "Not a teletype", or "Inappropriate ioctl for device") being delivered to the user. For many years the UNIX mail program
sendmail Sendmail is a general purpose internetwork email routing facility that supports many kinds of mail-transfer and delivery methods, including the Simple Mail Transfer Protocol (SMTP) used for email transport over the Internet. A descendant of t ...
A/UX: mail and "not a typewriter" (2/95)
article TA31349 on support.apple.com (February 27, 1995) contained this bug: when mail was delivered from another system, the mail program was being run non-interactively. If the destination address was local, but referred to a user name not found in the local password file, the message sent back to the originator of the email was the announcement that the person they were attempting to communicate with was not a typewriter.


See also

* lp0 on fire


References


External links

* {{Error messages Computer errors Input/output POSIX error codes