Pathmaker Programming Guide

Coding Custom Services
Creating Services and Servers
4–56 067868 Tandem Computers Incorporated
File Error Handling in a C Custom Source File
The common service utility library, PMSVCULC, contains functions to handle most
file I/O operations. You can invoke these functions in a Custom Source File for a
C service. When an I/O function detects an error, it automatically invokes the
lfe_advisory function, also found in the PMSVCULC file. The lfe_advisory function
places an appropriate message in the reply advisory field.
The following example lists a portion of the lfe_advisory function for processing file
error messages:
void lfe_advisory (
LOGICAL_FILE *file ) /*(in) pointer to the logical file
which suffered the error.*/
{
.
.
.
static struct {
short lowcode, highcode;
char *phrase;
} advisory_phrase [] = {
0, 0, "operation successful",
1, 1, "end of file",
2, 2, "invalid operation",
1, 9, "warning reported",
10, 10, "record already exists",
11, 11, "nonexistent file/record",
12, 12, "file in use",
13, 13, "invalid filename",
23, 23, "invalid record number",
22, 29, "application error",
30, 37, "out of system resources",
40, 40, "operation timed out",
43, 43, "disk is full",
45, 45, "file is full",
46, 46, "invalid key specified",
48, 48, "security violation",
49, 49, "access violation",
73, 73, "file/record is locked",
75, 75, "no transaction ID",
80, 80, "invalid audit operation",
90, 97, "transaction aborted",
198, 198, "DEFINE not found",
250, 250, "system not available",
SHRT_MIN, SHRT_MAX, "unrecoverable i/o error"
};