man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2014
 
 

ddi_get_lbolt(9F)

Name

ddi_get_lbolt, ddi_get_lbolt64 - return the number of clock ticks since boot

Synopsis

#include <sys/types.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>

clock_t ddi_get_lbolt(void);
int64_t ddi_get_lbolt64(void);

Interface Level

Solaris DDI specific (Solaris DDI).

Description

The ddi_get_lbolt() function returns a value that represents the number of clock ticks since the system booted. This value is used as a counter or timer inside the system kernel. The tick frequency can be determined by using drv_usectohz(9F), which converts microseconds into clock ticks.

The ddi_get_lbolt64() behaves essentially the same as ddi_get_lbolt(), except the value is returned in a longer data type (int64_t) that will not wrap for 2.9 billion years.

Return Values

The ddi_get_lbolt() function returns the number of clock ticks since boot in a clock_t type.

The ddi_get_lbolt64() function returns the number of clock ticks since boot in a int64_t type.

Context

These routines can be called from any context.

See Also

ddi_get_time(9F), drv_getparm(9F), drv_usectohz(9F)

Writing Device Drivers for Oracle Solaris 11.2

STREAMS Programming Guide