Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 27
Programming Considerations
Reading $RECEIVE
You can monitor the backup process by reading the $RECEIVE file in the same
manner as the backup process. The operating system sends a message to
$RECEIVE if the backup process fails.
Programming Considerations
Following are some general considerations for writing active backup programs in C.
Compile-Time and Linker Considerations
For TNS and accelerated programs, compiler and Binder issues are:
The nonstoph header file contains the declarations that support active backup
programming. (The functions that support fault-tolerant programming are
implemented in TAL. By using the nonstoph header, the appropriate TAL
interface code is generated.) Functions declared in the nonstoph header are
defined in the cnonstop library file.
HP provides two different file-reference models: the ANSI model and the alternate
model. Only the ANSI model supports fault-tolerant file operations (for example,
open with sync depth, backup open, get file state, and so on).
EDIT files do not support fault-tolerant file operations. Therefore, the
ANSISTREAMS pragma must be specified during compilation of the main function
so that the standard files will be opened as ANSI files (code 180 files) instead of
EDIT files.
Active backup programs must use the large-memory model. The large-memory
model uses 32-bit addressing and supports the wide-data model. Refer to the
C/C++ Programmer’s Guide for additional information about the large-memory
model.
For application portability and compatibility with future software releases, HP
recommends that active backup programs use the wide-data model. In the
wide-data model, the data type int is 32-bits.
Active backup C programs can include TAL code, but the TAL components of an
application cannot use passive backup programming techniques. Other mixed-
language programming is not allowed.
An active backup program can be accelerated.
An active backup program must run in the Common Run-Time Environment (CRE).
An active backup program can run only as a Guardian process; it cannot run as an
OSS process.
For TNS/R native programs, compiler and linker issues are: