STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
155
NAME
bcanput () – Checks for the existence of a flow control condition in the queue for a specified priority
band.
SYNOPSIS
#include <sys/stream.h>
int bcanput (queue_t *q, int pri);
ARGUMENTS
q
Pointer to the queue.
pri
Priority band for which the flow control check is requested.
DESCRIPTION
bcanput() routine tests if there is room left in the queue for the band specified by
pri
. If the queue does not
have a service procedure, it finds the queue that contains a service procedure in the direction of message flow.
It then tests to see if a message can be enqueued in the priority band specified by
pri
. If such a queue cannot
be found, bcanput() stops at the end of the stream.
If 0 is specified in
pri
, then bcanput() is equivalent to canput().
RETURN VALUES
Returns 1 if the message can be enqueued. If the message queue for the specified band is full, 0 is returned
and QB_WANTW is set in the queue that has the service procedure to automatically back-enable this queue.
CONSTRAINTS
bcanput() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order
can be held across this call.