Guardian Application Conversion Guide
Program Elements Affected by D-Series System Enhancements
Converting C Applications
096047 Tandem Computers Incorporated 5–9
Declaring
Process Identifiers
Your existing program might declare a process-ID variable to identify a process (for
example, an opener in an opener table):
short process_id[4];
Convert the process-ID variable declaration to a process-handle variable for process-
control operations or to a process-descriptor variable for returning information from a
Guardian procedure. Use a process-ID variable for compatibility with unconverted
C-series procedures.
A process handle is a 20-byte fixed-length structure. A process descriptor is a specific
form of process file name that always includes a node name and sequence number.
The following examples use declarations from the ZSYSC file to declare a process
handle and a process descriptor:
/* process handle: */
short process_handle[ZSYS_VAL_PHANDLE_WLEN];
/* process descriptor: */
char process_descriptor[ZSYS_VAL_LEN_PROCESSDESCR + 1];
The process-descriptor declaration has an extra byte for the terminating null character.
Avoiding Subvolume
Defaulting in Disk File
Names
Your existing program might use subvolume defaulting to represent a Guardian disk
file name in the form
volume.file-id
. For example:
char disk_file[17] = "$diskvol.filename";
Avoid subvolume defaulting in your program. If a file name requires the volume
name, also include the subvolume name:
char disk_file[ZSYS_VAL_LEN_FILENAME + 1] =
"$diskvol.subvol.filename";
Converting Guardian
Procedure Calls
Guardian procedure calls that you might need to convert are procedure calls that
accept or return:
A PIN parameter for a high-PIN process
A process-ID parameter
D-series procedures use a process handle (which includes the CPU and PIN values)
rather than a process ID to identify a process.
If you convert your program to run at a high PIN, then you must replace MYPID
procedure calls with calls to the PROCESS_GETINFO_ and
PROCESSHANDLE_DECOMPOSE_ procedures. “Converting a C Program to Run at
a High PIN,” later in this section, describes how to do this.
Appendix A lists the D-series procedures that supersede C-series procedures. For a
description of each procedure, refer to the Guardian Procedure Calls Reference Manual.