Tests for available room in a queue.
int
canput(q)
register queue_t * q;
The canput utility determines if there is room left in a message queue. If the queue does not have a service procedure, the canput utility searches farther in the same direction in the stream until it finds a queue containing a service procedure. This is the first queue on which the passed message can actually be queued. If such a queue cannot be found, the search terminates on the queue at the end of the stream.
The canput utility only takes into account normal data flow control.
q | Specifies the queue at which to begin the search. |
The canput utility tests the queue found by the search. If the message queue in this queue is not full, the canput utility returns a value of 1. This return indicates that a message can be put to the queue. If the message queue is full, the canput utility returns a value of 0. In this case, the caller is generally referred to as "blocked".
This utility is part of STREAMS Kernel Extensions.
List of Streams Programming References, Understanding STREAMS Messages in AIX 5L Version 5.1 Communications Programming Concepts.