Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

OTHERQ(9F)

NAME

OTHERQ, otherq − get pointer to queue’s partner queue

SYNOPSIS

#include <sys/stream.h>
#include <sys/ddi.h>
queue_t ∗OTHERQ(queue_t ∗q);

INTERFACE LEVEL

Architecture independent level 1 (DDI/DKI). 

ARGUMENTS

q Pointer to the queue. 

DESCRIPTION

The OTHERQ() function returns a pointer to the other of the two queue() structures that make up a STREAMS module or driver.  If q points to the read queue the write queue will be returned, and vice versa. 

RETURN VALUES

OTHERQ returns a pointer to a queue’s partner. 

CONTEXT

OTHERQ() can be called from user or interrupt context. 

EXAMPLES

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(q, min, max, hi, lo)
 3      queue_t ∗q;
 4      short min;
 5      short max;
 6      ushort hi;
 7      ushort lo;
 8  {
 9q->q_minpsz = min;
10q->q_maxpsz = max;
11q->q_hiwat = hi;
12q->q_lowat = lo;
13OTHERQ(q)->q_minpsz = min;
14OTHERQ(q)->q_maxpsz = max;
15OTHERQ(q)->q_hiwat = hi;
16OTHERQ(q)->q_lowat = lo;
17  }

SEE ALSO

Writing Device Drivers
STREAMS Programming Guide

SunOS 5.5/x86  —  Last change: 11 Apr 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026