DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer 5

WR(D3str)


WR -- get a pointer to the write queue

Synopsis

   #include <sys/stream.h>
   #include <sys/ddi.h>
   

queue_t *WR(queue_t *q);

Description

The WR function accepts a queue pointer as an argument and returns a pointer to the write queue of the same module.

Arguments


q
Pointer to the queue whose write queue is to be returned.

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.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

References

OTHERQ(D3str), RD(D3str)

Examples

In a STREAMS open(D2str) 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 member of both the read and write queues if it needs to identify the data structures from its put(D2str) or srv(D2str) 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)];
   	...
    5  }

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005