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