OTHERQ(D3DK) —
.IX \f4OTHERQ\fP(D3DK)
NAME
OTHERQ − get pointer to queue’s partner queue
SYNOPSIS
#include <sys/stream.h>
#include <sys/ddi.h>
queue_t ∗OTHERQ(queue_t ∗q);
ARGUMENTS
qPointer to the queue.
DESCRIPTION
The OTHERQ function returns a pointer to the other of the two queue structures that make up an instance of a STREAMS module or driver. If q points to the read queue the write queue will be returned, and vice versa.
RETURN VALUE
OTHERQ returns a pointer to a queue’s partner.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
SEE ALSO
RD(D3DK), WR(D3DK)
EXAMPLE
.IX \f4OTHERQ\fP(D3DK), example
This routine sets the minimum packet size, the maximum packet size, the high water mark, and the low water mark for the read and write queues of a given module or driver. It is passed either one of the queues. This could be used if a module or driver wished to update its queue parameters dynamically.
1 void
2 set_q_params(queue_t ∗q, long min, long max, ulong_t hi, ulong_t lo)
3 {
4register pl_t pl;
6(void) strqset(q, QMINPSZ, 0, min);
7(void) strqset(q, QMAXPSZ, 0, max);
8(void) strqset(q, QHIWAT, 0, hi);
9(void) strqset(q, QLOWAT, 0, lo);
10(void) strqset(OTHERQ(q), QMINPSZ, 0, min);
11(void) strqset(OTHERQ(q), QMAXPSZ, 0, max);
12(void) strqset(OTHERQ(q), QHIWAT, 0, hi);
13(void) strqset(OTHERQ(q), QLOWAT, 0, lo);
15 }
DDI/DKI — STREAMS