STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
220
NAME
strqget () – Retrieves information about a queue or priority band of the queue.
SYNOPSIS
#include <sys/types.h>
#include <sys/stream.h>
int strqget (queue_t *q, qfields_t what, uchar_t band, long *valp);
PARAMETERS
q
Pointer to the queue.
what
The field of the queue about which to return information. Valid what values are:
QHIWAT High water mark of the specified priority band.
QLOWAT Low water mark of the specified priority band.
QMAXPSZ Maximum packet size of the specified priority band.
QMINPSZ Minimum packet size of the specified priority band.
QCOUNT Number of bytes of data in messages in the specified priority band.
QFIRST Pointer to the first message in the specified priority band.
QLAST Pointer to the last message in the specified priority band.
QFLAG Flags for the specified priority band.
band
Priority band of the queue about which to obtain information.
valp
Pointer to the memory location where the value is to be stored.
DESCRIPTION
This function provides modules and drivers a way to retrieve various queue and queue-band parameters
without directly dereferencing the queue data structure.
A queue belonging to a module/driver with a synchronization level of SQLVL_NOSYNC may be simultaneously
manipulated by multiple threads. Therefore, the queue specified by
q
must be frozen by calling freezestr()
before calling insq(), rmvq(), strqget(), and strqset(). A call to unfreezestr() must be made to
unfreeze the queue after the above operations are complete.
RETURN VALUES
strqget() returns 0 on success and the actual value of the requested field is stored in the memory pointed to
by
valp
. Upon failure, it returns one of the following error codes.
EINVAL If the band specified in pri does not exist.
ENOENT If QBAD is specified or unidentified value is passed to strqget().
CONSTRAINTS
strqget() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order
can be held across this call.