Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Thursday, June 13, 2019
 
 

kstat2_hold_bykid (9F)

Name

kstat2_hold_bykid, kstat2_rele - hold and release a lock on a v2 kstat

Synopsis

#include <sys/types.h>
#include <sys/kstat2.h>

kstat2_t *kstat2_hold_bykid(kid_t ks_kid);

void kstat2_rele(kstat2_t *ksp);

Interface Level

Solaris DDI specific (Solaris DDI)

Parameters

kstat2_hold_bykid() function

ks_kid

ID of a previously created kstat.

kstat2_rele() function

ksp

v2 kstat handle previously obtained one of the kstat2_hold*() calls.

Description

Before the values in a kstat are modified, the kstat must be locked. These functions provide the operations to search for and lock a kstat and to release that lock once changes have been made.

kstat2_hold_bykid() locates a kstat using its unique ID, locks it and returns a pointer to the kstat to the caller.

kstat2_rele() releases the lock on the given kstat.

Return Values

The kstat2_hold_bykid() function returns a pointer to the locked kstat or NULL if a kstat is not found.

Context

These functions can be called from any context.

See Also

kstat2_create(9F), kstat2_install(9F), kstat2(9S)

Notes

It is recommended that locks be held for the absolute minimum time necessary to prevent kstat readers from blocking for a long time.