7.5 Errors <errno.h>

1

The header <errno.h> defines several macros, all relating to the reporting of error conditions.

2

The macros are

EDOM
EILSEQ
ERANGE

which expand to integer constant expressions with type int, distinct positive values, and which are suitable for use in #if preprocessing directives; and

errno

which expands to a modifiable lvalue[1] that has type int, the value of which is set to a positive error number by several library functions. It is unspecified whether errno is a macro or an identifier declared with external linkage. If a macro definition is suppressed in order to access an actual object, or a program defines an identifier with the name errno, the behavior is undefined.

3

The value of errno is zero at program startup, but is never set to zero by any library function.[2] The value of errno may be set to nonzero by a library function call whether or not there is an error, provided the use of errno is not documented in the description of the function in this International Standard.

4

Additional macro definitions, beginning with E and a digit or E and an uppercase letter,[3] may also be specified by the implementation.

Footnotes