C condition handling semantics

This section describes C condition handling in a POSIX(OFF) environment. If you run applications that contain POSIX functions, you should also read Language Environment and POSIX signal handling interactions, which discusses the interaction between POSIX signal handling and Language Environment condition handling.

C employs a global condition handling model, which, on initialization, defines the actions that are taken when a condition is raised. The actions defined by C apply to an entire enclave, not just to a routine or block within an enclave. You can alter a specific action that the C condition handler takes when a condition is raised, however, by coding signal() function calls in your applications.

C recognizes a number of errors; some correspond directly to the errors detected by the hardware or the operating system, and some are unique to C. All actions for condition handling are controlled by the contents of the C global error table. Table 1 contains default C-language error handling semantics.

Table 1. C conditions and default system actions
C Condition Origin Default action
SIGILL
  • Execute exception
  • Operation exception
  • Privileged operation
raise(SIGILL)
Abnormal termination (return code=3000)
SIGSEGV
  • Addressing exception
  • Protection exception
  • Specification exception
raise(SIGSEGV)
Abnormal termination (return code=3000)
SIGFPE
  • Data exception
  • Decimal divide
  • Exponent overflow
  • Fixed-point divide
  • Floating-point divide
raise(SIGFPE)
Abnormal termination (return code=3000)
SIGABRT abort() function
raise(SIGABRT)
Abnormal termination (return code=2000)
SIGABND Abend the function Abnormal termination (return code=3000)
SIGTERM Termination request
raise(SIGTERM)
Abnormal termination (return code = 3000)
SIGINT Attention condition Abnormal termination (return code = 3000)
SIGIOERR I/O errors Ignore the condition
SIGUSR1 User-defined condition Abnormal termination (return code=3000)
SIGUSR2 User-defined condition Abnormal termination (return code=3000)
Masked Start of change
  • Fixed-point overflow
  • HFP exponent underflow
  • HFP significance
End of change
These exceptions are disabled. They are ignored during the condition handling process, even if you try to enable them using the CEE3SPM callable service.