Managing return codes in Language Environment

This topic discusses how Language Environment calculates and uses return codes and reason codes during enclave termination. (The return codes between subroutine calls that are implemented with programming language constructs are addressed in the appropriate language-specific programming guides.)

Before Language Environment, some HLLs (in particular, C) handled conditions that occur in the runtime environment by using a return code-based model. Such a model typically allows return codes to be passed between called subroutines and from the main routine back to the operating system to communicate the status of requested operations. Language Environment, on the other hand, uses a condition-based model to communicate conditions, as described in Using condition tokens.

Although Language Environment supports applications that rely on passing return codes from called subroutines and checking these return codes, you are encouraged to use Language Environment condition handling mechanisms, such as user-written condition handlers, instead.