ZCOM C I/F Library Routines

ZCLOS (3X)

 

ZCLOS (3X)

NAME

zclos - Delete program input ZLU

SYNOPSIS

#include

<zcom/zcomsys.h>

#include

<zcom/zcomcall.h> /* if compiled with ANSI C (recommended) */

int32

zclos (zap)

zaddr_type *zap;

DESCRIPTION

Routine zclos closes the program ZLU set up by the zopen call and

 

returns the ZLU back to the system for reuse. This call should normally

 

always occur before a program terminates. If the program ZLU is not

 

closed, then the ZCOM subsystem will continue to hold all of the

 

resources associated with the ZLU and may add messages to the input

 

queue. This feature allows a program to open a ZLU on another

 

program’s behalf, or to be killed and rerun without losing any queued

 

messages. It is the programmer’s responsibility to ensure that all

 

unnecessary program ZLUs are closed before the program terminates.

 

If zclos is called to close a program’s primary ZLU, the program will no

 

longer have a primary ZLU. Usually, a program should open another

 

ZLU as the primary ZLU because some APIs may return an error if the

 

primary ZLU does not exist (e.g. zsend(3X)).

 

The libraries libzcom_c.a and libpthread.a must be linked into the calling

 

program by giving the options “-lzcom_c -lpthread” to cc(1) or ld(1).

Threads

This routine may be called from multi-threaded application using the

Considerations

POSIX (1003.1c) kernel threads API package. This routine has the

 

following characteristics when called by a multi-threaded application:

 

cancellation point

Thread cancellation can occur when a thread

 

 

calls this routine.

async-cancel unsafe The calling thread’s cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.

168

Chapter 4