HP UX 11i v1 I/O Cards manual

Models: UX 11i v1 I/O Cards

1 298
Download 298 pages 31.75 Kb
Page 273
Image 273

ZCOM C I/F Library Routines

ZREAD (3X)

RETURN VALUE Routine zread returns 0 if the call is successful. In addition, for a response message, a non-zeroreturn status rstat indicates there was a problem with the previous zsend(3X) call. A non-zeroreturn status with a terminal message or response indicates there was a problem with the terminal. For other message types, the return status is always 0.

If the zread call itself failed, a non-zeroerror code is returned, and the other return parameters do not contain valid values. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings.

EXAMPLE

#include <zcom/zcomsys.h> #include <zcom/zcomcall.h>

int32

ierr;

zaddr_type

zaddr;

uint32

mode;

zmhd_type

zmhd;

char

ibuf[size]; /* where size is user-determined; must be >= len */

int32

len;

int32

rlen;

int32

rstat;

if (ierr = zread(&zaddr, mode, &zmhd, ibuf, len, &rlen, &rstat)) { /* error return code */

}

else {

/* good return code */

}

NOTE

Check zmhd.mid.mstype to determine the message type. For response or

 

terminal messages, check for non-zerorstat to see if there was any

 

problem with the previous zsend(3X) or with the terminal.

 

 

Chapter 4

273

Page 273
Image 273
HP UX 11i v1 I/O Cards manual