Manpage of WR
Description: Manual Page
Keywords: ss7 ss7/ip ss7 over ip ss7 mtp ss7 sccp ss7 tcap sigtran mtp sccp tcap openss7 acb56 linux telephony pstn linux telephony linux nebs linux compactpci
WR
Section: Linux Fast-STREAMS DDI/DKI (9)
Updated: 2008-10-31
Index
Return to Main Contents
NAME
WR
- return the write queue of a
STREAMS queue pair
SYNOPSIS
#include <sys/stream.h>
-
queue_t *WR(q);
ARGUMENTS
- q
a pointer to either the read or write queue of a queue pair.
INTERFACE
STREAMS.
DESCRIPTION
WR()
returns the write queue associated with the queue pair indicated by the queue
pointer
q,
regardless of whether
q
points to the write queue or the write queue of the queue pair.
USAGE
WR()
is typically and often used to find the write queue from a pointer to one of
the queues in a queue pair.
See also
RD(9)
for finding the read queue in the pair, and
OTHERQ(9)
for finding the other queue in the pair.
RETURN
WR()
returns a pointer to the write queue of the queue pair referenced by
q.
ERRORS
WR()
always succeeds.
CONTEXT
WR()
can be called from any context, including user context, module procedures,
callouts, callbacks, soft interrupts (tasklets and bottom halves), and interrupt service routines.
MP-STREAMS
WR()
is MP-safe; however,
the caller is responsible for the validity of the reference
q.
References to
q
from a procedure, call-out or callback predicated on the queue pair to which
q
belongs
are guaranteed valid.
The caller must guarantee validity from call-outs, callbacks, soft interrupts
and interrupt service routines not predicated on the queue pair to which
q
belongs.
IMPLEMENTATION
queue(9)
structures are always allocated in pairs as an array of two
queue(9)
structure elements. The first structure in the array is always the read queue and has
QREADR
set in
q_flag;
the second, the write queue, with
QREADR
clear.
Because of this relationship between queues in a pair,
WR()
is easily implemented as a macro as follows:
#define WR(q) ((q->q_flag & QREADR) ? (q+1) : (q))
NOTICES
If
q
is invalid, the result is undefined.
If
q
is
NULL,
a kernel panic may occur.
If
q
points to a write queue,
q
will be returned.
SEE ALSO
WR(9),
OTHERQ(9),
SAMESTR(9).
BUGS
WR()
has no known bugs.
COMPATIBILITY
WR()
is compatible with
SVR 4.2 MP DDI/DKI[1],
and systems based on
SVR 4,
with the following portability considerations:
- ---
- SUPER-UX®[2],
UnixWare®[3],
LiS[4],
permit both a read or write queue pointer to be passed
as the
q
argument to
WR().
If a write queue pointer is passed to
WR(),
then the passed in write queue pointer is returned.
- ---
- AIX®[5],
OSF/1®[6],
Solaris®[7],
UXP/V®[8],
permit only a read queue to be passed as the
q
argument to
WR().
Passing a write queue to
WR()
on these implementations can cause a kernel panic.
On these systems
WR()
is often defined as:
#define WR(__q) ((__q)+1)
- ---
- WR()
is implemented on
Linux Fast-STREAMS
as both an
extern inline
function as well as a macro.
It accepts either read or write queue pointer and returns the passed in write
queue pointer when called with a write queue.
WR(q) == WR(WR(q))
and
WR(RD(q)) == (RD(q) + 1)
are invariantly true.
#undef WR
#define WR(__q) ((__q)+1)
is a valid alternative implementation if the
STREAMS
programmer wishes the more restrictive
WR()
behavior.
- ---
- Portable
STREAMS
drivers and modules should not
call
WR()
with a queue other than the read queue;
nor
rely upon
WR()
being defined as a macro or a function.
- ---
- Because the size and members of the
queue(9)
structure vary from implementation to implementation,
binary compatibility is not guaranteed.
See
STREAMS(9)
for additional compatibility information.
CONFORMANCE
SVR 4.2 MP DDI/DKI[1]
HISTORY
WR()
appears as part of
SVR 4.0 STREAMS[9].
WR()
first appeared in
SVR 3[10],
where it was defined as a macro.
REFERENCES
- [1]
- USL DDI/DKI,
Device Driver Interface/Driver-Kernel Interface (DDI/DKI) Reference Manual for Intel Processors, 1992, (Englewood Cliffs, New Jersey), AT&T UNIX System Laboratories, Inc., Prentice Hall.
- [2]
- SUPER-UX® Release 9.2,
SUPER-UX STREAMS Programmers Guide, 1999, NEC Corporation, NEC.
- [3]
- UnixWare® 7.1.3,
UnixWare® 7 STREAMS Programmer's Guide, 2002, (Lindon, Utah), Caldera International, Inc., Caldera.
<http://uw713doc.sco.com/>
- [4]
- LIS 2.18,
Linux STREAMS (LiS) 2.18.6 Source Code, Brian Bidulock, ed., OpenSS7 Corporation.
<http://www.openss7.org/>
- [5]
- AIX® 5L Version 5.1,
AIX STREAMS Programmers Guide, 2001, (Boulder, Colorado), Internatonal Business Machines Corp., IBM.
<http://publibn.boulder.ibm.com/>
- [6]
- Digital® UNIX (OSF/1.2),
Digital UNIX: Network Programmers Guide, 1996, (Palo Alto, California), Digital Equipment Corporation, Hewlett-Packard Company.
<http://www.true64unix.compaq.com/docs/>
- [7]
- Solaris® 8,
STREAMS Programming Guide, August 1999, (Palo Alto, California), Sun Microsystems, Inc., Sun.
[Part No: 805-7478-05]
<http://docs-pdf.sun.com/>
- [8]
- UXP/V® V10L10,
UXP/V Programmer's Guide: STREAMS V10, 1997, Fujitsu Limited, Fujitsu.
- [9]
- SVR 4,
UNIX® System V Release 4 STREAMS Programmer's Guide, 1990, (Englewood Cliffs, New Jersey), AT&T UNIX System Laboratories, Inc., Prentice Hall.
- [10]
- SVR 3,
UNIX® System V Release 3 STREAMS Programmer's Guide, (Englewood Cliffs, New Jersey), AT&T UNIX System Laboratories, Inc., Prentice Hall.
TRADEMARKS
- OpenSS7tm
- is a trademark of OpenSS7 Corporation.
- Linux®
- is a registered trademark of Linus Torvalds.
- UNIX®
- is a registered trademark of The Open Group.
- Solaris®
- is a registered trademark of Sun Microsystems.
Other trademarks are the property of their respective owners.
IDENTIFICATION
-
Linux Fast-STREAMS: Package streams version 0.9.2.4 released 2008-10-31.
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
(See roff source for permission notice.)
Index
- NAME
- SYNOPSIS
- ARGUMENTS
- INTERFACE
- DESCRIPTION
- USAGE
- RETURN
- ERRORS
- CONTEXT
- MP-STREAMS
- IMPLEMENTATION
- NOTICES
- SEE ALSO
- BUGS
- COMPATIBILITY
- CONFORMANCE
- HISTORY
- REFERENCES
- TRADEMARKS
- IDENTIFICATION
This document was created by
man2html,
using the manual pages.
Time: 22:00:59 GMT, May 21, 2013