C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Running and Debugging C and C++ Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
19-6
Retrieving Startup Information
Retrieving Startup Information
The Guardian C run-time library includes six functions that allow the retrieval of the
process startup message, the PARAM message, and the ASSIGN messages. You can
call these functions only from Guardian processes. These functions are listed in
Table 19-1. For a detailed description of each function, see the Guardian TNS C
Library Calls Reference Manual or the Guardian Native C Library Calls Reference
Manual.
Program Termination
The program termination phase of execution begins when your process returns from
the function main() or calls the exit() or terminate_program() library function.
In either case, these occurs:
All file buffers are flushed.
All open files are closed.
The destructors are invoked for global and static variables in C++.
The process is terminated with a certain completion code, depending on what
caused termination.
When your process returns from main() with no return value, your process completes
with a completion code of 0, normal termination.
When your process calls exit() or terminate_program(), your process
completes with normal or abnormal termination, depending on the completion code you
assign to the status or options and completion_code parameters, respectively.
For active backup process pairs, the call to exit() stops both primary and backup
processes.
Table 19-1. C Functions That Retrieve Process Startup Information
Function Action
get_assign_msg() Retrieves a specified ASSIGN message.
get_assign_msg_by_name() Retrieves the ASSIGN message that
corresponds to the logical-unit name requested.
get_max_assign_msg_ordinal() Determines how many ASSIGN messages are
assigned to a particular process.
get_param_by_name() Retrieves the value of the parameter that
corresponds to the parameter name requested.
get_param_msg() Retrieves the PARAM message.
get_startup_msg() Retrieves the process startup message.