Creating and using persistent C environments

Four routines are available to create and use a persistent C environment. These routines are used by an assembler language application that needs a C environment available to support the C functions that it calls. C main routines cannot be called in persistent C environments. The four routines are:
EDCXHOTC
Sets up a persistent C environment (no library)
EDCXHOTL
Sets up a persistent C environment (with library)
EDCXHOTU
Runs a function in a persistent C environment
EDCXHOTT
Terminates a persistent C environment

An initialization routine, EDCXHOTC or EDCXHOTL (depending upon whether the called C subroutines will need the z/OS® XL C library functions), is called to create a C environment. This call returns a handle that can be used (through EDCXHOTU) to call C subroutines. The environment persists until it is explicitly terminated by calling EDCXHOTT.

The functions that act as entry points for these routines are __xhotc(), __xhotl(), __xhotu(), and __xhott(), respectively. For more information on these four functions, refer to Library functions for system programming C.

Restrictions:
  1. C main routines are not supported in persistent C environments.
  2. The RENT compiler option is not supported in the persistent environment described in this topic.
  3. Exception handling is not supported in persistent C environments.

As an alternative to the persistent environments, you can also create and retain a C environment using the preinitialized programming interface. This interface supports the RENT compiler option, but is less versatile in other respects. z/OS Language Environment® provides a callable service for preinitialization called CEEPIPI. This is described in z/OS Language Environment Programming Guide. You may also find information in Retaining the C environment using preinitialization helpful.