errno.h
The errno.h
header provides macros for reporting error conditions in function calls of the standard library and for any program that includes it.
Excluding macro EILSEQ
.
Macros
EDOM
- 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. ERANGE
- 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. errno
- Error number
Expands to(* __errno_location())
Reported error condition of function call (thread-local storage).errno
is initially 0 at program startup.errno
should 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. Onceerrno
has been assessed, it should be reset to 0.errno
has thread-local storage duration but for each subsequent thread after the initial thread,errno
will have an indeterminate value and should therefore be set to 0 before calling a function as previously stated.
The__errno_location
function returns anint *
which is dereferenced.