| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:41:52 GMT | ||||||||||||||||
| |||||||||||||||||
| Manpage of M_ERRORDescription: 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 compactpciM_ERRORSection: Linux Fast-STREAMS DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEM_ERROR - STREAMS error messageFORMATThe M_ERROR message block is a datab(9) structure and associated data buffer that contains structured data. The contents of the M_ERROR message block is zero, one, or two character width integer error numbers. An M_ERROR message is a high priority message that consists of one M_ERROR message block. INTERFACEDESCRIPTIONThe M_ERROR message is generated by a driver or module and sent upstream by drivers or modules to report some downstream error condition. When the message reaches the Stream head, the Stream is marked so that all subsequent system calls issued to the Stream, excluding close(2s) and poll(2s), will fail with errno(3) set to the first data byte of the message. POLLERR is set if the Stream is being polled [see poll(2s)]. All proceses sleeping on a system call to the Stream are awakened. An M_FLUSH(9) message with FLUSHRW is then sent downstream from the Stream head. The Stream maintains two error fields, one for the read-side and one for the write-side. The, older, zero- and one-byte form M_ERROR message sets both of these fields to the error specified by the first byte in the message, or cleared the error when a zero-byte message arrived. The second style of the M_ERROR message is two bytes long. The first byte is the read error and the second byte is the write error. This allows modules to set a different error on the read-side and write-side. If one of the bytes is set to NOERROR, then the field for the corresponding side of the Stream is unchanged. This allows a module to adjust an error on one side of the Stream. For example, if the Stream head was not in an error state and a module sent an M_ERROR message upstream with the first byte set to [EPROTO] and the second byte set to NOERROR, all subsequent write-like system calls (for example, write(2s), putmsg(2)) will still succeed: only read-like system calls (read(2s), getmsg(2)), will fail with errno(3) set to [EPROTO]. If a byte is set to zero (0), the error state is cleared for the corresponding side of the Stream. The values of NOERROR and zero (0) are not valid for the one-byte form of the M_ERROR message. WHen this message type is received, the first byte of the message is put into the Stream head (sd_rerror) and the STRDERR flag is set; the second byte is placed in sd_werror and the STDWERR flag is set. If the error code in the message has a special value NOERROR, the corresponding flag is not set. However, if the error flag is set, a read(2s) or write(2s) will fail, and the value returned to the process in errno(3) is taken from sd_rerror or sd_werror. The error condition prevents all further reads and writes to the Stream util it is closed, or the Stream head receives a NOERROR code in an M_ERROR message. The relevant processes (all processes blocked on read or write, or blocked awaiting acknowledgement to an M_IOCTL(9) message, or that have registered to receive {SIGPOLL} for the S_ERROR event) are then awoken or signalled. Finally, a M_FLUSH(9) message is sent downstream to discard all data queued in the Stream. Note that many of the STREAMS system calls and streamio(7) IO controls block awaiting message arriving at the Stream head or flow control to subside on a message band. These system calls and streamio(7) IO controls describe what occurs in the event of the receipt of what is termed an asynchronouserror , that is, arrival at the Stream head of an M_ERROR(9) message. The putctl(9), and putnextctl(9), STREAMS utility functions are useful for modules generating the zero-byte form of the message. The putctl1(9), and putnextctl1(9), STREAMS utility functions are useful for modules generating the one-byte form of the message. The putctl2(9), and putnextctl2(9) STREAMS utility functions were added in support of the newer two-byte error message. M_ERROR messages cannot be generated directly by user level processes. M_ERROR messages arriving at a non-multiplexing driver should be discarded (ignored and freed). M_ERROR messages can be generated by drivers and modules. M_ERROR messages are consumed by the Stream head. USAGEThe following guidelines provide best practise for generation of the M_ERROR message for drivers and modules:
SEE ALSOCOMPATIBILITYThe M_ERROR STREAMS message is compatible with SVR 4.2 MP STREAMS, and implementations based on SVR 4, with the following portability considerations:
See STREAMS(9) for additional compatibility information. CONFORMANCEHISTORYThe M_ERROR message first appeared in SVR 3[5]. The two-byte format for the M_ERROR message first appeared in SVR 4.2[4]. 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: 10:55:06 GMT, May 21, 2013 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:41:52 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |