errno--Error Return Code Variable
The PSL errno variable is set by various PSL built-in functions to indicate the reason for a failure. All functions that can potentially set errno are also required to reset the errno variable to zero and have it remain zero if the function is successful. Functions that do not set the errno variable do not reset it to zero either. This requirement validates usage styles such as the following:
The user can also write values to the errno variable. However, there should be little cause to set errno since it is reset by all functions that set it.
The errno variable is reset to zero by many built-in functions at the start of their processing; and in some functions, clearing can occur before arguments are processed, leading to errno being cleared before being processed as an argument. Thus, when passing errno as an argument to a built-in function, BMC Software recommends that you make a copy in a temporary variable and pass the copy.