The means by which each function provides its error numbers is specified in its description. Some functions provide the error number in a variable accessed through the symbol errno . The value of errno should only be examined when it is indicated to be valid by a function's return value. No function in this specification sets errno to zero to indicate an error. For each thread of a process, the value of errno is not affected by function calls or assignments to errno by other threads.
Some functions return an error number directly as the function value.
These functions return a value of zero to indicate success. If more than one error occurs in processing a function call, any one of the possible errors may be returned, as the order of detection is undefined. Implementations may support additional errors not included in this list, may generate errors included in this list under circumstances other than those described here, or may contain extensions or limitations that prevent some errors from occurring. Implementations will not generate a different error number from the ones described here for error conditions described in this specification, but may generate additional errors unless explicitly disallowed for a particular function. Only these symbolic names should be used in programs, since the actual value of the error number is unspecified.