liveBook · Manning

Errno

errno is a C library macro identifying a modifiable integer error indicator associated with the current thread or execution context.

How 3 Manning books explain it

Modern C, Third Edition

errno is a C library-provided modifiable object or macro designating an integer error indicator associated with the current thread or execution context.

How it is used
Supports C library error detection, diagnosis, recovery, and cleanup around operations that may fail.
How deep it goes
Explains error-state use, resetting, preservation, and portability constraints, but defers detailed thread semantics and implementation internals.
Examples
Uses puts with EOF and perror, puts_safe with reset state, and fprintnumbers with saved errno and cleanup.
What you can do after
Diagnose library failures, preserve error state during cleanup, and reset errno after handled recovery.

Read how Modern C, Third Edition explains errno →

Modern C

errno is a C standard library macro identifying the thread-local integer error indicator set by library functions.

How it is used
Supports C library error checking by recording specific failure conditions alongside function return values.
How deep it goes
Explains errno's role, perror's dependence on it, state resetting, and assignments in a strtoul implementation.
Examples
Uses puts with EOF, perror, and exit, then implements strtoul overflow and invalid-base handling.
What you can do after
Diagnose library failures with return-value checks, perror, and errno values such as ERANGE and EINVAL.

Read how Modern C explains errno →

Rust in Action: Systems programming concepts and techniques

errno is a C and POSIX process-global error indicator that system calls may set to identify a failure condition.

How it is used
Uses a global error code to signal failures from system calls such as read() and close().
How deep it goes
Explains return-value checking, symbolic failure codes, and global-state drawbacks without developing POSIX internals.
Examples
Uses read() and close(), with EINTR and EIO illustrating interruption and input/output failure.
What you can do after
Diagnose system-call failures by checking a global error value after an operation returns.

Read how Rust in Action: Systems programming concepts and techniques explains errno →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.