Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / OTHERQ.9f
blobb2d4ede1f00f4910a51574acd69f76fca2eeb56e
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\"  Copyright (c) 2006, Sun Microsystems, Inc.,  All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH OTHERQ 9F "Jan 16, 2006"
8 .SH NAME
9 OTHERQ, otherq \- get pointer to queue's partner queue
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/stream.h>
14 #include <sys/ddi.h>
18 \fBqueue_t *\fR\fBOTHERQ\fR(\fBqueue_t *\fR\fIq\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Architecture independent level 1 (DDI/DKI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIq\fR\fR
30 .ad
31 .RS 5n
32 Pointer to the queue.
33 .RE
35 .SH DESCRIPTION
36 .sp
37 .LP
38 The \fBOTHERQ()\fR function returns a pointer to the other of the two
39 \fBqueue\fR structures that make up a STREAMS module or driver. If \fIq\fR
40 points to the read queue the write queue will be returned, and vice versa.
41 .SH RETURN VALUES
42 .sp
43 .LP
44 The \fBOTHERQ()\fR function returns a pointer to a queue's partner.
45 .SH CONTEXT
46 .sp
47 .LP
48 The \fBOTHERQ()\fR function can be called from user, interrupt, or kernel
49 context.
50 .SH EXAMPLES
51 .LP
52 \fBExample 1 \fRSetting Queues
53 .sp
54 .LP
55 This routine sets the minimum packet size, the maximum packet size, the high
56 water mark, and the low water mark for the read and write queues of a given
57 module or driver. It is passed either one of the queues.  This could be used if
58 a module or driver wished to update its queue parameters dynamically.
60 .sp
61 .in +2
62 .nf
63  1  void
64  2  set_q_params(q, min, max, hi, lo)
65  3      queue_t *q;
66  4      short min;
67  5      short max;
68  6      ushort_t hi;
69  7      ushort_t lo;
70  8  {
71  9              q->q_minpsz = min;
72 10              q->q_maxpsz = max;
73 11              q->q_hiwat = hi;
74 12           q->q_lowat = lo;
75 13              OTHERQ(q)->q_minpsz = min;
76 14              OTHERQ(q)->q_maxpsz = max;
77 15              OTHERQ(q)->q_hiwat = hi;
78 16              OTHERQ(q)->q_lowat = lo;
79 17  }
80 .fi
81 .in -2
83 .SH SEE ALSO
84 .sp
85 .LP
86 \fIWriting Device Drivers\fR
87 .sp
88 .LP
89 \fISTREAMS Programming Guide\fR