| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:41:49 GMT | ||||||||||||||||
| |||||||||||||||||
| Manpage of PUTPMSGDescription: 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 compactpciPUTPMSGSection: Linux Fast-STREAMS System Calls (2)Updated: 2008-10-31 Index Return to Main Contents NAMEputpmsg - put a band message to a STREAMS character deviceSYNOPSIS#include <stropts.h>
ARGUMENTS
DESCRIPTIONputpmsg() generates a STREAMS message from the buffer supplied in the specified ctlptr and datapr for the queue band band and with options specified by flags and delivers the message to the stream head associated with the STREAMS character special file fd. The resulting STREAMS message can contain a control part as specified by ctlptr, a data part as specified by datptr, or both. The control part, when present, will generate M_PROTO or M_PCPROTO message blocks. The data part, when present, will generate M_DATTA message blocks. When both control and data parts are present, an M_PROTO or M_PCPROTO message block followed by one or more M_DATA message blocks will be generated. fd is an open file descriptor for the STREAMS character special file to which the STREAMS message is to be written. ctlptr and datptr point to a strbuf structure, which contains the following members:
struct strbuf {
int maxlen; /* Maximum buffer length. */
int len; /* Length of data. */
char *buf; /* Pointer to buffer. */
};
ctlptr points to a strbuf structure describing the control part to be included in the message, or NULL if there is no control part. The buf member of the strbuf structure pointed to by ctlptr indiates the start of the information to sent in the control part, and the len member indicates the length of the information for the control part. datptr points to a strbuf structure describing the data part to be included in the message, or NULL is there is no data part. The buf member of the strbuf structure pointed to by ctlptr indiates the start of the information to sent in the data part, and the len member indicates the length of the information for the data part. len can be zero (0) to send zero-length data. band specifies the queue band to which to write data when flags is set to MSG_BAND. When flags is set to other than MSG_BAND, band must be set to zero (0). flags specifies whether to send a high priority message or a band message. flags can be one of the following values:
RETURN VALUEUpon success, putpmsg() returns zero (0). Upon failure, putpmsg() returns -1 and sets errno to an appropriate error number. ERRORSWhen putpmsg() fails, it returns -1 and sets errno to one of the following:
Other errors may be returned by putpmsg(). If the protocol module sends an M_ERROR(9) message to the stream head, the error returned on all subsequent write operations, including putpmsg(), is specified in the M_ERROR(9) message by the protocol module. Which errors are returned under what conditions form part of the necessary documentation of the protocol module. NOTICESMulti-Threadingputpmsg() is thread-safe; however, multiple threads performing concurrent partial writes on the same stream will interfere with each other. POSIX mandatory file locks, (see lockf(3)), can be used to avoid interference. Asynchronous I/OIf the file is set for blocking operation (see fcntl(2)), then putpmsg() will block waiting for the band specified in band (with MSG_BAND set in flags) to permit sending messages under band flow control. (putpmsg() will not wait for a message block to formulate the STREAMS message, but will return [ENOSR] if it cannot allocate the necessary message block). When the file is set for non-blocking operation, putpmsg() will not block, but will return the appropriate error number ([ENOSTR], [EAGAIN], [EWOULDBLOCK]) if the STREAMS message could not be formulated and sent immediately. SEE ALSOintro(2), poll(2s), putmsg(2), write(2s), streamio(7). BUGSCOMPATIBILITYputpmsg() is compatible with SVID[1], XID[2], SUSv2[3], SUSv3[4], POSIX, and implementations based on SVR 4.2[5], including AIX®, HP-UX®, LiS, OSF/1®, Solaris®, SUPER-UX®, UnixWare®, UXP/V®. putpmsg() is compatible with LiS[6] with the following exceptions:
Linux Fast-STREAMS provides system calls for __NR_getpmsg and __NR_putpmsg that are used to implement this system call. (glibc has prototypes for this system call.) In addition, Linux Fast-STREAMS recognizes the ``invalid'' buffer length to write(2s) used by LiS to emulate the __NR_getpmsg system call, permitting LiS libraries to be used with Linux Fast-STREAMS. CONFORMANCESVID[1], XID[2], SUSv2[3], SUSv3[4], POSIX. HISTORYputpmsg() first appeared in SVR 4[7]. 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: 21:42:42 GMT, September 09, 2010 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:41:49 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |