errno
From cppreference.com
Defined in header <errno.h>
|
||
#define errno /*implementation-defined*/ |
||
errno
is a preprocessor macro that expands to a thread-local (since C11) modifiable lvalue of type int. Several standard library functions indicate errors by writing positive integers to errno
. Typically, the value of errno
is set to one of the error codes listed in <errno.h>
as macro constants beginning with the letter E
followed by uppercase letters or digits.
The value of errno
is 0 at program startup, and although library functions are allowed to write positive integers to errno
whether or not an error occurred, library functions never store 0 in errno
.
Library functions perror and strerror can be used to obtain textual descriptions of the error conditions that correspond to the current errno
value.