SVR5 and SCO OpenServer 5
test for room in a message queue
int canput(queue_t *q);
canput searches through the stream (starting at q)
until it finds a queue containing a service routine, or until
it reaches the end of the stream.
If found, the queue containing the service routine is
tested to see if a message can be enqueued.
If the queue is full, canput marks the queue to automatically
back-enable the caller's service routine when the amount of data
in messages on the queue has reached its low water mark.
Pointer to the message queue.
canput returns 1 if a message can be placed on the queue.
0 is returned if a message cannot be enqueued because of flow control.
The driver is responsible for both testing a queue with
canput and refraining from placing a message on the queue if
It is possible, because of race conditions,
to test for room using canput
and get an indication that there is room for a message,
and then have the queue fill up
before subsequently enqueuing the message,
causing a violation of flow control.
This is not a problem,
since the violation of flow control in this case is bounded.
In multithreaded drivers,
the q argument may not reference
(for example, an argument of
is erroneous in a multithreaded driver
and is disallowed by the DDI).
is provided as a multiprocessor-safe equivalent
to the common call canput(q->q_next),
which is no longer allowed
Base or Interrupt.
Does not block.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
The caller cannot have the stream frozen
when calling this function.
for an example of canput.
1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005