STREAMS-UX Programmer's Guide (February 2007)
STREAMS Utilities Supported by HP-UX
Appendix B
160
NAME
canputnext () – Checks for the flow control conditions in a stream.
SYNOPSIS
#include <sys/stream.h>
int canputnext (queue_t *q);
PARAMETERS
q
Pointer to a queue.
DESCRIPTION
canputnext() routine tests if there is room left in the queue (q->q_next). If the queue does not have a
service procedure, then it finds the queue that contains service procedure in the direction of message flow
starting at q->q_next and tests to see if a message priority can be enqueued. If such a queue cannot be found,
then it stops at the end of the stream.
RETURN VALUES
Returns 1 if the message can be enqueued. If the message queue for the specified band is full, 0 is returned
and QWANTW is set in the queue that has the service procedure, thereby this queue is automatically
back-enabled
CONSTRAINTS
canputnext() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock
order can be held across this call