ZCOM C I/F Library Routines

ZREAD (3X)

PARAMETERS

 

zap

Pointer to program ZCOM address. Source to get input

 

messages.

mode

ZcREAD_W_WAIT (0) - Read with wait.

 

The ztimr() call can be used to set a timeout period that will

 

cause the zread() call to unsuspend and continue after the

 

timeout period has elapsed.

 

ZcREAD_WO_WAIT (1) - Read without wait.

 

Note: If mode = 0, the program is suspended until there is a

 

message on the input queue. If mode = 1, and there is no

 

message on the queue, error ZENODATA (-24) is returned.

 

Otherwise, the message is placed in ibuf.

 

If bit ZCOM_ZREAD_SHARE (0x2000) is set, the input may

 

be shared by multiple processes. This allows multiple

 

processes to read (and wait) on the same ZLU. When a

 

message arrives, only one of the waiting processes will return

 

with the data.

 

If bit ZCOM_ZREAD_QUIET (0x4000) is set, the automatic

 

response mechanism is suppressed. Normally, when a

 

message is sent (e.g., by zsend(3X)) with a mode requesting

 

response, a response is generated automatically when the

 

message is read by zread. This bit is used to suppress this

 

response, and the caller is responsible for checking the

 

request mode and sending a response back to the originator if

 

necessary. This feature is intended for multiplexing programs

 

and should be used with care. This bit is not used in

 

zpeek(3X).

mhp

Pointer to message header. It is the message header received

(Return

with the data buffer. NULL may be specified if the caller does

Param)

not require the returned message header. It is described in

 

the subsection on ‘Message Header’ in the Multiprotocol ACC

 

Programmers’ Reference Guide. See the data structure

 

zmhd_type in zcomsys.h for more detail.

ibuf (Return

Buffer for the received data.

Param)

 

len

Maximum length in bytes of the buffer ibuf.

298

Chapter 4