For Fortran
You can set and alter the user return code using the SYSRCS or SYSRCX Fortran services. You can test the value of this field using SYSRCT. Depending on how the enclave is terminated, the value of the user return code could become the enclave return code.
- STOP 101
- CALL SYSRCX(101)
- CALL SYSRCS(201)
- CALL EXIT
The call to SYSRCS sets the enclave user return code to 201 and the call to EXIT causes the enclave user return code to be used as the enclave return code.
The return code modifier depends on the operating system and the severity of the condition, as shown in Table 1.
Condition severity | Return code modifier |
---|---|
2 | 2000 |
3 | 3000 |
4 | 4000 |
If the enclave terminates due to an unhandled condition and the ABTERMENC(RETCODE) runtime option is in effect, then the enclave return code is the sum of the enclave user return code and the return code modifier. For example, when CALL SYSRCS(201) is executed and termination occurs as a result of an unhandled condition of severity 3, the enclave return code is 3201.