| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:42:05 GMT | ||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| Manpage of QBUFCALLDescription: 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 compactpciQBUFCALLSection: OpenSS7 STREAMS Compatibility DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEqbufcall - install a buffer callbackSYNOPSIS#define _SUN_SOURCE
ARGUMENTS
DESCRIPTIONWhen allocation of a buffer fails as a result of a failed call to allocb(9) or esballoc(9) the qi_srvp(9) routine should place the message that invoked the allocb(9) or esballoc(9) call back on the queue with putbq(9) and call the qbufcall() function with qenable(9) as the function argument and a pointer to the queue as the arg argument to the call. The size and priority arguments should be the same as the size and priority arguments that were issued to allocb(9). If esballoc(9) failed, the size argument to qbufcall() should be zero (0). In this way, the queue qi_srvp(9) routine will be recalled once there is sufficient memory to allocate the necessary buffer and message block. Buffer calls initiated with qbufcall() can be cancelled by calling qunbufcall(9) with the returned bufcall id. RETURNqbufcall() returns a bufcall_id_t as follows: typedef int bcid_t; typedef int bufcall_id_t; Upon success, qbufcall() returns a non-zero bufcall id and the specified function will be called with the specified arg at a later time when buffers of the necessary size become available. Upon failure, qbufcall() returns zero (0) and no call will be generated to the specified function. ERRORSWhen qbufcall() encounters and error, it returns zero (0). qbufcall() fails and returns zero (0) when the function pointer to the callback function, function, is NULL, or qbufcall() cannot allocate the necessary internal structures for the callback. CONTEXTqbufcall() can be called from any context including user context, queue procedures, callouts, callbacks, soft interrupts (tasklets and bottom halves), and interrupt service routines. MP-STREAMSqbufcall() is MP-safe. Considerations should be given when writing the callback function that a qbufcall() callback function can execute at the same time as any non-exclusive qi_qopen(9), qi_qclose(9), qi_putp(9) or qi_srvp(9) procedure, non-exclusive qbufcall(), or qtimeout(9) callback or interrupt service routine. However, the qbufcall() callback function will be serviced by the same CPU as the CPU from which the qbufcall() was issued. Therfore, the callback function will not execute until after qbufcall() returns. Because the servicing thread and the current thread are the same, the qbufcall() callback will not be invoked until after the function that called qbufcall() returns. This means that it is safe to store the returned bufcall id in global variables accessed by the callback function. It is also safe to hold private locks taken by the callback function across a call to qbufcall(9). This is the same situation as that of the qtimeout(9), bufcall(9) and timeout(9) functions. NOTICESqbufcall() is a Solaris®-specific function: _SUN_SOURCE must be defined before including DDI/DKI include files to expose this symbol. OpenSS7 STREAMS Compatibility must also have been compiled with CONFIG_STREAMS_COMPAT_SUN or CONFIG_STREAMS_COMPAT_SUN_MODULE set. The primary difference between qbufcall() and bufcall(9) is that the STREAMS scheduler will take the same locks as a queue procedure on the associated queue, q, before invoking the qbufcall() callback function. No locks are taken whatsoever when scheduling a bufcall(9) callback. For a driver or module that has no synchronization (no perimeters or SQLVL_NONE), calling qbufcall() has the same effect as calling bufcall(9). bufcall_id_t should be treated as an opaque type that can be tested for equality to zero. The value should not otherwise be manipulated. Although bufcall_id_t has traditionally been implemented as an integer index, qbufcall() implements bufcall id values internally as out-dating pointer into a strevent structure. EXAMPLESSee bufcall(9). SEE ALSOqunbufcall(9), mi_bufcall(9), allocb(9), qenable(9), allocb(9), esballoc(9), putbq(9), qi_qopen(9), qi_qclose(9), qi_putp(9), qi_srvp(9), qtimeout(9), bufcall(9). BUGSCOMPATIBILITYqbufcall() is compatible with Solaris®[1] with the following portability considerations:
See suncompat(9) and STREAMS(9) for additional compatibility considerations. CONFORMANCEHISTORYqbufcall() is a Solaris® specific function that first appeared in Solaris® 2. 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: 04:19:32 GMT, May 23, 2013 | ||||||||||||||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:42:05 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. | |||||||||||||||||||||||||||||