| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:41:57 GMT | ||||||||||||||||
| |||||||||||||||||
| Manpage of TIMEOUTDescription: 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 compactpciTIMEOUTSection: Linux Fast-STREAMS DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEtimeout - start a timerSYNOPSIS#include <sys/stream.h>
ARGUMENTS
INTERFACEDESCRIPTIONtimeout() starts a timer with duration ticks number of system clock ticks, that, upon expiry, will invoke the supplied timeout function callback timo_fcn (if the timo_fcn function pointer is non-NULL) with the supplied argument arg. The timeout callback function timo_fcn is a function returning void and taking a single caddr_t argument as follows: typedef void timo_fcn_t(caddr_t arg); The callback function timo_fcn will be executed at some time greater than or equal to the interval specified in the ticks argument. RETURNtimeout() returns a toid_t defined as follows: typedef int toid_t; typedef int timeout_id_t; Upon success, timeout() returns a non-zero timeout id and the timeout is scheduled. Upon failure, timeout() returns a zero (0) timeout id and no timeout is scheduled. ERRORSWhen timeout() fails, it returns a zero (0) timeout id. timeout() fails when it cannot allocate the internal structures for the timeout. If it is important that a timeout be scheduled with assurance, the return value should always be checked. CONTEXTtimeout() can be called from any context including user context, qi_qopen(9), qi_qclose(9), qi_putp(9), and qi_srvp(9) procedures, bufcall(9), qbufcall(9), timeout(9) and qtimeout(9) callbacks, and interrupt service routines. MP-STREAMStimeout() is MP-safe. Considerations should be given when writing the callback function that a timeout() callback function can execute at the same time as any queue qi_qopen(9), qi_qclose(9), qi_putp(9) or qi_srvp(9) procedure, qwriter(9) callout, bufcall(9), qbufcall(9), timeout(9) or qtimeout(9) callback or interrupt service routine. In addition, for a sufficiently small tick values, the callback function may execute before the call to timeout(9) returns. Nevertheless, the timeout() callback function will be serviced by the same thread as the thread from which the timeout() was issued. Therefore, the callback function will not execute until after timeout() returns, no matter whether ticks is zero or negative. Because the servicing thread and the current thread are the same, the timeout() callback will not be invoked until after the function that called timeout() returns. This means that it is safe to store the returned timeout id in global variables access by the callback function. This is the same situation for qtimeout(9), qbufcall(9), timeout(9), bufcall(9) and esbbcall(9) functions. However, if the timeout() was generated from a qi_qopen(9), qi_qclose(9), qi_putp(9) or qi_srvp(9) procedure, or was generated from within a mi_bufcall(9), qbufcall(9), qtimeout(9), callback, or other queue referenced bufcall(), esbbcall(9), timeout(9), callback, then the STREAMS executive is aware of the queue to which the callback function is to be referenced and will generate a buffer call internally that is referenced against the queue within whose synchronization context the call was invoked. This makes the timeout() function safer than the normal SVR 4.2 MP equivalent. See mp-streams(9) for additional information. NOTICESFor architectural independence, STREAMS drivers and modules should not specify the ticks argument directly, but should use the drv_usectosz(9) and drv_hztousec(9) DKI functions, the Linux HZ define, or some other quantum independent conversion function to convert to and from microseconds or some other absolute unit of time. toid_t and timeout_id_t should be treated as an opaque type that can be tested for equality to zero. The value should not otherwise be manipulated. Linux Fast-STREAMS implements timeout id values internally as a pointer to a strevent structure containing a Linux timer. On 64-bit architectures, this value should never be stored as an int, nor converted to any integer type with less bits than a pointer. All outstanding timeout callbacks allocated with timeout() must be cancelled with a call to untimeout(9) before invalidating any of the references passed as an argument to the callback function. When the argument is a queue(9) pointer, all outstanding timeout calls must be cancelled with untimeout(9) before the queue is deallocated (i.e. before returning from the qi_qclose(9)) procedure. SEE ALSOuntimeout(9), dtimeout(9), itimeout(9), qtimeout(9), quntimeout(9), drv_usectohz(9), drv_hztousec(9). BUGSCOMPATIBILITYtimeout() is source-level compatible with SVR 4.2 MP DDI/DKI, Solaris® and LiS[1] with the following exceptions:
See STREAMS(9) for additional compatibility considerations. CONFORMANCESVR 4.2 MP DDI/DKI[7], Solaris® documentation. HISTORYtimeout() first appeared in SVR 2[8]. 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: 23:46:57 GMT, May 24, 2013 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:41:57 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |