WR(D3) WR(D3)
NAME
WR - get a pointer to the write queue
SYNOPSIS
#include <sys/stream.h>
#include <sys/ddi.h>
queue_t *WR(queue_t *q);
Arguments
q Pointer to the queue whose write queue is to be
returned.
DESCRIPTION
The WR function accepts a queue pointer as an argument and
returns a pointer to the write queue of the same module.
Return Values
The pointer to the write queue.
USAGE
Note that when WR is passed a write queue pointer as an
argument, it returns a pointer to this write queue.
Level
Base or Interrupt.
Synchronization Constraints
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
Examples
In a STREAMS open(D2) routine, the driver or module is passed
a pointer to the read queue. The driver or module can store a
pointer to a private data structure in the q_ptr field of both
the read and write queues if it needs to identify the data
structures from its put(D2) or srv(D2) routines.
1 extern struct xxx_dev[];
...
2 xxxopen(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *crp)
3 {
...
3 q->q_ptr = (caddr_t)&xxx_dev[getminor(*devp)];
4 WR(q)->q_ptr = (caddr_t)&xxx_dev[getminor(*devp)];
Copyright 1994 Novell, Inc. Page 1
WR(D3) WR(D3)
...
5 }
REFERENCES
OTHERQ(D3), RD(D3)
NOTICES
Portability
All processors
Applicability
ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2