ACC Error Guide

ZCOM Error Codes
ZCOM Error Code and zcomerror( ) Routine
Chapter 220
ZCOM Error Code and zcomerror( ) Routine
The ZCOM error code is a 32-bit integer. It is returned with most of the
ZCOM APIs to indicate the result of the request. The error code is zero if
the request is successful, and non-zero if a failure occurred.
zcomerror routine returns a character string which corresponds to the
supplied ZCOM error code. This routine may be called to format error
messages describing the reason for the error in a terminal request.
The format and a typical use of the zcomerror routine is as follows:
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
char *errmsg, *statmsg, ibuf[100];
int32 ierr, len, rlen, req, rstat;
uint32 mode;
zaddr_type zaddr;
zmhd_type zmhd;
len = 100;
mode = 0; /* zread ‘wait’ option */
if(ierr = zread(&zaddr, mode, &zmhd, ibuf, len, &rlen, &rstat))
{
errmsg = zcomerr (ierr);
}
else
{
req = zmhd.mrq.mrqstat;
statmsg = zcomstatus (req, rstat);
}
The parameter to the zcomerror call is:
ierr - The error code returned by the ZCOM subsystem.