errno.h header provides macros for reporting error conditions in function calls of the standard library and for any program that includes it.
- Error: Domain
Expands to 33
Error when input argument to a mathematics function is outside the domain of the function.
POSIX.1-2017: Mathematics argument out of domain of function.
- Error: Range
Expands to 34
Error when input argument to a mathematics function is outside the range of the function.
POSIX.1-2017: Result too large.
- Error number
Reported error condition of function call (thread-local storage).
errnois initially 0 at program startup.
errnoshould be set to 0 before calling a function, whether part of the standard library or the program itself, which is known to report error conditions. Once
errnohas been assessed, it should be reset to 0.
errnohas thread-local storage duration but for each subsequent thread after the initial thread,
errnowill have an indeterminate value and should therefore be set to 0 before calling a function as previously stated.
__errno_locationfunction returns an
int *which is dereferenced.