Not a typewriter

Not a typewriter

In computer science "Not a typewriter" or ENOTTY is an error code defined in the errno.h found on many Unix systems. This code is used to indicate that an attempt has been made to use a non-TTY device as a TTY device.

Details

"Typewriter" was what early UNIX systems called a terminal. This usage goes all the way back to the First Edition of the Unix Programmer's Manual, dated November 3, 1971. For example, the description of the "hup" command was "hup hangs up the phone on the typewriter which uses it." The abbreviation TTY, which occurs widely even in modern UNIX systems, stood for "Teletype." The generic term "typewriter" was probably used because "Teletype" was a registered trademark of AT&T subsidiary Teletype Corporation 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.

If this error code is returned, then at some point a diagnostic message may be output. Because some people consider "Not a typewriter" to be a confusing message some systems display a different confusing message such as "Inappropriate ioctl [input/output control] for device" instead. The real source of these confusing messages is, alas, often more subtle.

This message is usually not the result of an error related to the I/O device, but was 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 naive 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[1] contained this bug: when mail was delivered from another system, the mail program was (of course) 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.

References

  1. ^ A/UX: mail and "not a typewriter" (2/95) article TA31349 on support.apple.com (February 27, 1995)

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Typewriter — Mechanical desktop typewriters, such as this Underwood Five, were long time standards of government agencies, newsrooms, and offices …   Wikipedia

  • typewriter — /tuyp ruy teuhr/, n. 1. a machine for writing mechanically in letters and characters like those produced by printers types. See illus. under keyboard. 2. Print. a type style that gives the appearance of typewritten copy. 3. Older Use. a typist.… …   Universalium

  • Typewriter desk — A typewriter desk is an antique desk form meant to hold a typewriter in an efficient position for the typist. This position is usually a few inches lower than the 29 inch (73.7 cm) height of the typical antique desktop.The first generations of… …   Wikipedia

  • IBM Selectric typewriter — The IBM Selectric typewriter (occasionally known as the IBM Golfball typewriter) is an influential electric typewriter design. It was introduced in 1961.Instead of a basket of pivoting typebars the Selectric had a pivoting type element… …   Wikipedia

  • Oliver Typewriter Company — This article is about the typewriter manufacturer. For the tractor manufacturer, see Oliver Corporation. The Oliver Typewriter Company Type Privately held company Industry Typewriters …   Wikipedia

  • TV Typewriter — The TV Typewriter was a video terminal that could display 2 pages of 16 lines of 32 upper case characters on a standard television. The Don Lancaster design appeared on the cover of Radio Electronics magazine in September 1973.cite journal | last …   Wikipedia

  • Blickensderfer typewriter — A Blickensderfer 5 typewriter The Blickensderfer Typewriter was designed by George C Blickensderfer (1850 1917) in 1893. It was originally intended to compete with Remington desk typewriters, but ended up being known for its portability.… …   Wikipedia

  • Chinese typewriter — Ming Kwai Typewriter A Chinese typewriter produced by Shuangge, with 2,450 keys …   Wikipedia

  • Chinese electro-mechanical typewriter — An electro mechanical Chinese typewriter was invented and patented by Dr. Lin YuTang. The patent, No.2613795, was filed on April 17, 1946 by Dr. Lin. It was issued by the USPTO, on October 14, 1952. Dr. Lin had a prototype machine custom built by …   Wikipedia

  • Royal Typewriter Company — Infobox Company company name = The Royal Typewriter Company company company type = Private company genre = foundation = 1904 [cite web |url = http://www.boston.com/news/nation/articles/2007/11/07/last word on typewriter not written yet/ |title =… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”