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 Statistics Library Functionskstat_chain_update(3KSTAT)


NAME

 kstat_chain_update - update the kstat header chain

SYNOPSIS

 
cc [ flag ... ] file ... -lkstat [ library ...]
#include <kstat.h>
kid_t kstat_chain_update(kstat_ctl_t *kc);

DESCRIPTION

 

The kstat_chain_update() function brings the user's kstat header chain in sync with that of the kernel. The kstat chain is a linked list of kstat headers (kstat_t's) pointed to by kc->kc_chain, which is initialized by kstat_open(3KSTAT). This chain constitutes a list of all kstats currently in the system.

During normal operation, the kernel creates new kstats and delete old ones as various device instances are added and removed, thereby causing the user's copy of the kstat chain to become out of date. The kstat_chain_update() function detects this condition by comparing the kernel's current kstat chain ID(KCID), which is incremented every time the kstat chain changes, to the user's KCID, kc->kc_chain_id. If the KCIDs match, kstat_chain_update() does nothing. Otherwise, it deletes any invalid kstat headers from the user's kstat chain, adds any new ones, and sets kc->kc_chain_id to the new KCID. All other kstat headers in the user's kstat chain are unmodified.

RETURN VALUES

 

The kstat_chain_update() function returns the new KCID if the kstat chain has changed, 0 if it hasn't, or -1 on failure.

FILES

 
/dev/kstat
kernel statistics driver

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelUnsafe

SEE ALSO

 

kstat(3KSTAT), kstat_close(3KSTAT), kstat_data_lookup(3KSTAT), kstat_lookup(3KSTAT), kstat_open(3KSTAT), kstat_read(3KSTAT), kstat_write(3KSTAT), attributes(5)


SunOS 5.9Go To TopLast Changed 27 Jun 2000

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