##### Synopsis

    #include <errno.h>

    #ifdef __MT

    int *__errno(void);

    #define errno (*__errno())

    #else

    int errno;

    #endif

##### Description

In the single threaded build of the CrossWorks library errno expands to a modifiable lvalue of type int, the value of which is set to a positive error number by several library functions. In the multi threaded build of the CrossWorks library errno expands to a function call that returns a pointer to an int. This function must be implemented by the application.

The ISO standard does not specify whether errno is a macro or an identifier declared with external linkage. Portable programs must not make assumptions about the implementation of errno.

The value of errno is zero at program startup, but is never set to zero by any library function. The value of errno may be set to a nonzero value by a library function, and this effect is documented in each functio that does so.

The header file <errno.h> defines the macros EDOM, EILSEQ, and ERANGE which expand to integer constant expressions with type int, distinct positive values, and which are suitable for use in #if preprocessing directives.

##### Portability

errno conforms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).