qtimeout man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

QTIMEOUT(9F)							  QTIMEOUT(9F)

NAME
       qtimeout - execute a function after a specified length of time

SYNOPSIS
       #include <sys/stream.h>
       #include <sys/ddi.h>

       timeout_id_t qtimeout(queue_t *q, void (*func)(void *),
	    void *arg, clock_t ticks);

INTERFACE LEVEL
       Solaris DDI specific (Solaris DDI).

PARAMETERS
       q
		Pointer to STREAMS queue structure.

       func
		Kernel function to invoke when the time increment expires.

       arg
		Argument to the function.

       ticks
		Number	of  clock ticks to wait before the function is called.
		Use drv_usectohz(9F) to convert microseconds to clock ticks.

DESCRIPTION
       The qtimeout() function schedules the specified	function  func	to  be
       called  after  a	 specified time interval. func is called with arg as a
       parameter. Control is immediately returned to the caller. This is  use‐
       ful  when  an  event is known to occur within a specific time frame, or
       when you want to wait for I/O processes when an interrupt is not avail‐
       able  or	 might	cause problems. The exact time interval over which the
       timeout takes effect cannot be guaranteed, but the  value  given	 is  a
       close approximation.

       The  qtimeout()	function  is  tailored	to  be	used with the enhanced
       STREAMS framework interface which is based on the  concept  of  perime‐
       ters.   (See  mt-streams(9F).) qtimeout() schedules the specified func‐
       tion to execute after entering the perimeters associated with the queue
       passed  in  as the first parameter to qtimeout(). All outstanding time‐
       outs and bufcalls must  be  cancelled  (using,  respectively,  quntime‐
       out(9F) and qunbufcall(9F)) before a driver close routine can block and
       before the close	 routine calls qprocsoff(9F).

       The qprocson(9F) function must be called before calling qtimeout().

RETURN VALUES
       The qtimeout() function returns an opaque non-zero  timeout  identifier
       that  can  be passed to quntimeout(9F) to cancel the request.  Note: No
       value is returned from the called function.

CONTEXT
       The qtimeout() function can be called from user, interrupt,  or	kernel
       context.

SEE ALSO
       drv_usectohz(9F),  mt-streams(9F),  qbufcall(9F), qprocson(9F), qunbuf‐
       call(9F), quntimeout(9F)

       Writing Device Drivers

       STREAMS Programming Guide

				 Jan 16, 2006			  QTIMEOUT(9F)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net