OpenSS7
SS7 for the
Common Man
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.
Last modified: Sat, 01 Nov 2008 10:41:52 GMT
Home TopIndex FirstPrev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Man Pages -> Manpage of RD
Quick Links

Download

SCTP

SIGTRAN

SS7

Hardware

STREAMS

Asterisk

Related

Package

Manual

FAQ

Man Pages

Applications

SS7 Stack

ISDN Stack

SIGTRAN Stack

VoIP Stack

MG Stack

SS7/ISDN Devices

IP Transport

Embedded Systems

OS

Documentation

FAQ

SIGTRAN

Design

Conformance

Performance

References

Man Pages

Manuals

Papers

Home

Overview

Status

Documentation

Resources

About

News

Manpage of RD

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


RD

Section: Linux Fast-STREAMS DDI/DKI (9)
Updated: 2008-10-31
Index Return to Main Contents

NAME

RD - return the read queue of a STREAMS queue pair

SYNOPSIS

#include <sys/stream.h>

queue_t *RD(q);

ARGUMENTS

q

a pointer to either the read queue or write queue of the queue pair.

INTERFACE

STREAMS.

DESCRIPTION

RD() returns the read queue associated with the queue pair indicated by the queue pointer q, regardless of whether q points to the read queue or the write queue of the queue pair.

USAGE

RD() is typically and often used to find the read queue from a pointer to one of the queues in a queue pair.

See also WR(9) for finding the write queue in the pair, and OTHERQ(9) for finding the other queue in the pair.

RETURN

RD() returns a pointer to the read queue of the queue pair referenced by q.

ERRORS

RD() always succeeds.

CONTEXT

RD() can be called from any context, including user context, module procedures, call-outs, callbacks, soft interrupts (tasklets and bottom halves), and interrupt service routines.

MP-STREAMS

RD() 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, RD() is easily implemented as a macro as follows:

#define RD(q) ((q->q_flag & QREADR) ? (q) : (q-1))

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

RD(9), OTHERQ(9), SAMESTR(9).

BUGS

RD() has no known bugs.

COMPATIBILITY

RD() is compatible with SVR 4.2 MP DDI/DKI, and systems based on SVR 4, with the following portability considerations:

---
SUPER-UX®, UnixWare®, LiS, permit both a read or write queue pointer to be passed as the q argument to RD(). If a read queue pointer is passed to RD(), then the passed in read queue pointer is returned.
---
AIX®, OSF/1®, Solaris®, UXP/V®, permit only a write queue to be passed as the q argument to RD(). Passing a read queue to RD() on these implementations can cause a kernel panic. On these systems RD() is often defined as:

#define RD(__q) ((__q)-1)

---
RD() 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 read queue pointer when called with a read queue. RD(q) == RD(RD(q)) and RD(WR(q)) == (WR(q) - 1) are invariantly true.

#undef RD
#define RD(__q) ((__q)-1)

is a valid alternative implementation if the STREAMS programmer wishes the more restrictive RD() behaviour.

---
Portable STREAMS drivers and modules should not call RD() with a queue other than the write queue; nor rely upon RD() 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

HISTORY

RD() appears as part of SVR 4.0 STREAMS.

RD() first appeared in SVR 3, 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: 02:10:28 GMT, May 23, 2013
OpenSS7
SS7 for the
Common Man
Home TopIndex FirstPrev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Man Pages -> Manpage of RD
Last modified: Sat, 01 Nov 2008 10:41:52 GMT
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.