NAME
zqsze - Read ZLU input queue size
SYNOPSIS
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h> /* if compiled with ANSI C (recommended) */
int32 zqsze (zap, zqhdp)
zaddr_type *zap;
zqhd_type *zqhdp;
DESCRIPTION
Routine zqsze will return
the queue header information, which includes the number of messages,
i.e., the number of buffers (zqhd_type->qnmsg) queued
to the specified program ZLU. An error is returned if the ZLU is not
a program ZLU.
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 Considerations
This routine may be called from a multi-threaded application
using the 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. |
async-signal
unsafe | It cannot be called from a signal handler. |
fork unsafe | It cannot be called by a child process
after fork(2) but before exec(2). |
PARAMETERS
zap | ZCOM address
|
zqhdp (Return param) |
| | ZCOM queue header data structure.
This structure has the following definition:
|
| | typedef struct { |
| | | uint32 qnmsg; | /* Number of msgs on queue */ |
| | | uint32 qlimit; | /* Max # of msgs allowed on queue */ |
| | | zbhd_type *qhead; | /* Pointer to 1st msg on queue */ |
| | | zbhd_type *qtail; | /* Pointer to last msg on queue */ |
| | uint32 qmmax; | /* Historical max # of msgs on queue
*/ |
| | uint32 qtmsg; | /* Total # of msgs through queue */ |
| | uint32 qbytes; | /* Number of bytes on queue */ |
| | uint16 qwaiter; | /* Number of waiters on this queue */ |
| | uint16 qflag; | /* Queue flags */ |
| | uint32 qfdata; | /* Queue function data */ |
| | uint32 spare1; | /* Reserved, not used */ |
| | void (*qfunc)(); | /* Queue function to call */ |
| } | zqhd_type; | |
| | | |
| Note that in 32-bit mode,
32-bit padding fields are inserted before the pointer fields. These
are to maintain the same layout in both 32/64-bit modes. Such padding
fields are not shown here and also should not be referenced directly. |
RETURN VALUE
Routine zqsze 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.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
int32 ierr;
zaddr_type zaddr;
zqhd_type zqhd;
if (ierr = zqsze (&zaddr, &zqhd)) {
/* error return code */
}
else {
/* good return code */
}
FILES
/opt/acc/include/zcom/zcomsys.h | ZCOM subsystem general include file, containing
data types, data structures, constants, error codes, masks, etc.
Note that this must be the first include file before any other ZCOM
include files. |
/opt/acc/include/zcom/zcomcall.h | ZCOM routine function prototypes (requires
ANSI C compilation). |