ZCOM C I/F Library Routines

ZSEND (3X)

 

 

ZSEND (3X)

NAME

 

zsend – Send data buffer to a ZLU

SYNOPSIS

 

#include

<zcom/zcomsys.h>

#include

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

int32 zsend (zap, mode, mhp, ibuf, len, rstat)

zaddr_type

*zap;

uint32

 

mode;

zmhd_type

 

*mhp;

char

 

*ibuf;

int32

 

len

int32

 

*rstat;

DESCRIPTION

Routine zsend sends a buffer to the specified ZLU. The zcntl(3X) routine

 

 

is used for sending control messages to a terminal ZLU.

 

 

Zero length buffers are allowed (usually sent to other program ZLUs).

 

 

For example, a zero length send may be used to signify a special event

 

 

with some information in the header tag words, mhp->mid.ztagw1and

 

 

mhp->mid.ztagw2.

 

 

The response returned from zsend is through the primary ZLU unless a

 

 

different source ZLU is specified in the header (mhp->mid.mzsrce).

 

 

Note that a program must call zopen() to allocate a primary or auxiliary

 

 

input ZLU before calling the zsend() routine. This must be done even if

 

 

the program does not need an input ZLU, for example, if it is not doing

 

 

any zread() calls and is only doing zsend() calls with mode =

 

 

ZcMODE_NO_WAIT (0) (send no-wait) where it does not care about the

 

 

return status.

 

 

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 a 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:

Chapter 4

307