Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kstat(3K)

kstat_close(3K)

kstat_data_lookup(3K)

kstat_lookup(3K)

kstat_open(3K)

kstat_read(3K)

kstat_write(3K)

kstat_chain_update(3K)

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

kstat_chain_update() brings the user’s kstat header chain in sync with the kernel’s.  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(3K).  This chain constitutes a list of all kstats currently in the system.  During normal operation, the kernel will occasionally create new kstats and delete old ones, as various device instances come and go.  When this happens, the user’s copy of the kstat chain becomes out of date. 

kstat_chain_update() detects this 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 KCID’s match, kstat_chain_update() does nothing.  Otherwise, it deletes any invalid kstat headers from the user’s kstat chain, and 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

kstat_chain_update() 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

SEE ALSO

kstat(3K), kstat_close(3K), kstat_data_lookup(3K), kstat_lookup(3K), kstat_open(3K), kstat_read(3K), kstat_write(3K)

SunOS 5.5/SPARC  —  Last change: 26 May 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026