CRE Programmer's Guide

CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-9
Program Initialization
You must resolve how to remove the call to the INITIALIZER procedure from your
program.
The Guardian Procedure Calls Reference Manual describes the INITIALIZER
procedure and each of the SIO procedures. The Guardian Programmer’s Guide
describes how to use the INITIALIZER system procedure with SIO procedures.
Program Initialization
Your program begins execution when the operating system transfers control to your
program’s object code. Before executing the code that you wrote, however, the run-
time library for your main routine initializes its run-time environment. For programs
running in the CRE, initialization includes a call to a CRE initialization function.
In the Guardian environment, the CRE performs the tasks described in this subsection.
In the OSS environment on G-series systems, the TNS CRE does not:
Establish a trap/signal handler
Process startup messages
Initialize standard files
Initialize process pair information
The CRE initialization function establishes the CRE’s internal data structures, I/O
model, and so forth, as well as shared facilities such as the user data heap, standard
files (standard input, standard output, and standard log), and parameters that control
process pairs. After the CRE has established its environment and set up shared
facilities, it calls a language-specific initialization function for each language that is
represented by a routine in your program, except TAL and pTAL. Each language-
specific initialization function sets up its data structures and file I/O model for the
language that it supports.
When the CRE completes initialization, it is set up to provide the services described in
this section, and returns control to the run-time library that called it, namely, the run-
time library for your main routine. The run-time library completes its own initialization
and returns control to your main routine, which begins executing the instructions that
you wrote.
Designating a Main Routine
A program’s main routine is the first routine to execute when the operating system
passes control to your process. An object file must have exactly one main routine to be
a runnable program. Each language supported by the CRE provides syntax to specify