| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:41:55 GMT | ||||||||||||||||
| |||||||||||||||||
| Description: Manual PageKeywords: 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 compactpciMSGDSIZESection: Linux Fast-STREAMS DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEmsgdsize - calculate the size of the data in a STREAMS messageSYNOPSIS#include <sys/stream.h>
ARGUMENTS
INTERFACEDESCRIPTIONmsgdsize() returns the number of data bytes in the M_DATA(9) blocks contained in the message pointed to by mp. The number of byte considered to be contained in an M_DATA(9) block are the number of bytes between the b_rptr and b_wptr pointers. If b_rptr is greater than or equal to b_wptr, then the M_DATA(9) message block is considered to contain zero bytes. Otherwise the number of bytes contained is the pointer difference: (b_wptr - b_rptr). USAGEmsgdsize() is not a very useful function. It is used by the Stream head only to implement the I_NREAD(7) intput-output control command. msgdsize() is not very useful because all data blocks after the initial data block in a message are considered to be of type M_DATA(9) regardless of their actual data type (see M_DATA(9)). Therefore, the second of the following two statements is faster (see msgsize(9)): size = msgdsize(mp); size = (DB_TYPE(mp) == M_DATA) ? msgsize(mp) : msgsize(mp->b_cont); RETURNUpon success, msgdsize() returns the number of bytes contained in M_DATA(9) blocks in in the message. Upon failure, msgdsize() returns zero (0). ERRORSmsgdsize() fails if the message pointer mp is NULL. CONTEXTmsgdsize() can be called from any context, including user context, module procedures, callouts, callbacks, soft interrupts (tasklets and bottom halves), and interrupt service routines. MP-STREAMSmsgdsize() is MP-safe; however, the caller must ensure exclusive access to the passed in message. See mp-streams(9). NOTICESmsgdsize() will fail and potentially panic the kernel if the passed in message pointer, mp, that is invalid. If the passed in message pointer, mp, is NULL; however, the function will return zero (0). Portable STREAMS drivers and modules will not pass msgdsize() a NULL or invalid message pointer as an argument. IMPLEMENTATIONmsgdsize() is implemented as an extern inline for speed, as follows:
SEE ALSOBUGSCOMPATIBILITYmsgdsize() is compatible with SVR 4.2 MP DDI/DKI[1], and implementations based on SVR 4[2] with the following portability considerations:
See STREAMS(9) for additional compatibility information. CONFORMANCEHISTORYmsgdsize() appears as part of SVR 4.0 STREAMS[4]. msgdsize() first appeared in SVR 3[5]. REFERENCES
TRADEMARKS
Other trademarks are the property of their respective owners. IDENTIFICATION
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
Index
This document was created by man2html, using the manual pages. Time: 22:31:34 GMT, May 18, 2013 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:41:55 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |