drv_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);
ARGUMENTS
microsecs The number of microseconds to convert to its HZ equivalent.
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
DESCRIPTION
drv_usectohz() converts a length of time expressed in microseconds to HZ, the unit of time based on the the kernel parameter HZ defined in sys/param.h. The time arguments to timeout(9F) and delay(9F) are expressed in HZ, as well as the kernel variable lbolt, which is readable through drv_getparm(LBOLT).
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 made part of a kernel that was compiled with a value of HZ different from that with which the driver was compiled.
RETURN VALUES
The value returned is the number of HZ units equivalent to the microsecs argument. No error value is returned. If the HZ 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_getparm(9F), drv_hztousec(9F), timeout(9F)
SunOS 5.1/SPARC — Last change: 11 Apr 1991