ZCOM Tables and Data Structures

ZLU Tables

its node and ZLU number. The number of a ZLU can be found using zname given its name and node.

ZOWNER - PID number of owner

When the ZLU is created, the PID number of the creating program is inserted in this field. When the program closes the ZLU, this field is cleared. For system created ZLUs, this field is zero (e.g., terminal ZLUs assigned by TTGEN).

ZTIMER, ZCLOCK - ZLU timeout control

These two parameters act together as a timer clock. The timer value ZTIMER is set by an application program (via the time parameter in the ztimr routine). This field is moved into ZCLOCK and decremented by 1 every second. When ZCLOCK reaches zero, a timer message is added to the queue pointed to by the ZLU. ZCLOCK is then reset to ZTIMER and the timer continues. If there are already 10 or more messages on the queue, no timer message is queued. Timer processing stops when ZTIMER and ZCLOCK are reset to zero via the ztimr routine (a zero time parameter value).

ZLOCK - ZLU lock pointer

It is a pointer to a lock structure used within the kernel. The lock is used to provide exclusive access to the ZLU in a multi-processor environment. The locks are created one per ZLU by the ZCOM LDM driver during ZCOM subsystem startup.

REFCNT - Reference count

This field is to keep track of the number of active references to this ZLU. When the ZCOM subsystem processes an application request that refers to a ZLU, it increment this count. On completion, the count is decremented. On a zclos( ), the driver will wait until all active requests are cleared before closing and releases a ZLU.

Chapter 3

59