The Open Group Error Numbers Most functions can provide an error number. 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.