ArticleslgStudy

computer science

Not a typewriter

Not a typewriter is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Not a typewriter rather than just read about it. In short: In computing, "Not a typewriter" or ENOTTY is an error code defined in the errno.h found on many Unix systems. This code is now used to indicate that an invalid ioctl (input/output control) number was specified in an ioctl system call.

Not a typewriter — main illustration
Not a typewriter — illustration

Key takeaways

  • Not a typewriter belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Not a typewriter to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Not a typewriter from memory before moving on to harder problems.

Reference excerpt

In computing, "Not a typewriter" or ENOTTY is an error code defined in the errno.h found on many Unix systems. This code is now used to indicate that an invalid ioctl (input/output control) number was specified in an ioctl system call.

Details This error originated in early UNIX. In Version 6 UNIX and earlier, I/O control was limited to serial-connected terminal devices, typically a teletype (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 (I/O control) call, the ENOTTY error code was retained. Early computers and Unix systems used electromechanical typewriters as terminals. The abbreviation TTY, which occurs widely in modern UNIX systems, stands for "Teletypewriter." For example, the original meaning of the SIGHUP signal is that it Hangs UP the phone line on the teletypewriter which uses it. 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. 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 for device" instead.

Occurrence In some cases, this message will occur even when no ioctl 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 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 Media related to Not a typewriter at Wikimedia Commons

Illustrations

Not a typewriter: "Not a Typewriter" error code in Linux
"Not a Typewriter" error code in Linux

Worked examples

Example 1 — a first encounter with Not a typewriter

Start with the simplest possible case. Write down what Not a typewriter claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Not a typewriter before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Not a typewriter ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Not a typewriter

In research
Not a typewriter appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Not a typewriter in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Not a typewriter is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer errors, Input/output, POSIX error codes, so understanding it makes those chapters shorter.
In everyday life
Look for Not a typewriter outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Not a typewriter” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Not a typewriter in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Not a typewriter means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Not a typewriter out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Not a typewriter in simple terms?

In computing, "Not a typewriter" or ENOTTY is an error code defined in the errno.h found on many Unix systems. This code is now used to indicate that an invalid ioctl (input/output control) number was specified in an ioctl system call.

Why does Not a typewriter matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Not a typewriter?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Not a typewriter.

Tags

  • Computer errors
  • Input/output
  • POSIX error codes

Keep exploring