Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Kernel Functions for Driversdrv_usectohz(9F)


NAME

 drv_usectohz - convert microseconds to clock ticks

SYNOPSIS

 
#include <sys/types.h>
#include <sys/ddi.h>
clock_t drv_usectohz(clock_t microsecs);

INTERFACE LEVEL

 

Architecture independent level 1 (DDI/DKI).

PARAMETERS

 
microsecs
The number of microseconds to convert.

DESCRIPTION

 

drv_usectohz() converts a length of time expressed in microseconds to a number of system clock ticks. The time arguments to timeout(9F) and delay(9F) are expressed in clock ticks.

drv_usectohz() is a portable interface for drivers to make calls to timeout(9F) and delay(9F) and remain binary compatible should the driver object file be used on a system with a different clock speed (a different number of ticks in a second).

RETURN VALUES

 

The value returned is the number of system clock ticks equivalent to the microsecs argument. No error value is returned. If the clock tick equivalent to microsecs is too large to be represented as a clock_t, then the maximum clock_t value will be returned.

CONTEXT

 

drv_usectohz() can be called from user or interrupt context.

SEE ALSO

 

delay(9F), drv_hztousec(9F), timeout(9F)

Writing Device Drivers


SunOS 5.9Go To TopLast Changed 12 Nov 1992

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.