ACC Programmer's Reference Guide

296 Chapter4
ZCOM C I/F Library Routines
ZTIMR (3X)
PARAMETERS
RETURN VALUE Routine ztimr returns 0 if successful. Otherwise, a non-zero error code
is returned. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM
error codes and their meanings.
NOTES A timer value of zero will cancel the timer processing on the specified
ZLU. The ztimr call causes timer messages to be added regularly to the
input queue of the specified program ZLU. A zread call to that ZLU will
return a message type of 3 (in the type parameter) if it is a timer
message. Thus the waiting program (or thread) is able to take
alternative action, rather than waiting indefinitely for a response. If the
program ZLU input queue has ten or more messages in it, the ZCOM
subsystem will not add another timer message to the queue. This is to
prevent a potential problem of consuming all of t he ZCOM buffers with
timer messages due to one or more applications not reading their input
queues.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
int32 ierr;
zaddr_type zaddr;
int32 time;
if (ierr = ztimr (&zaddr, time)) {
/* error return code */
}
else {
/* good return code */
}
zap ZCOM address (program ZLU).
time Timer value in seconds (1-32767). A timer value of 0 will cancel the
timer processing on the specified program ZLU. That is, no new timer
messages are added to the program’s input queue.