2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH KSTAT_CHAIN_UPDATE 3KSTAT "Aug 3, 2004"
8 kstat_chain_update \- update the kstat header chain
12 \fBcc\fR [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lkstat\fR [ \fIlibrary\fR\&.\|.\|.]
17 \fBkid_t\fR \fBkstat_chain_update\fR(\fBkstat_ctl_t *\fR\fIkc\fR);
23 The \fBkstat_chain_update()\fR function brings the user's kstat header chain in
24 sync with that of the kernel. The kstat chain is a linked list of kstat headers
25 (\fBkstat_t\fR's) pointed to by \fIkc\fR->\fBkc_chain\fR, which is initialized
26 by \fBkstat_open\fR(3KSTAT). This chain constitutes a list of all kstats
27 currently in the system.
30 During normal operation, the kernel creates new kstats and delete old ones as
31 various device instances are added and removed, thereby causing the user's copy
32 of the kstat chain to become out of date. The \fBkstat_chain_update()\fR
33 function detects this condition by comparing the kernel's current kstat chain
34 ID (KCID), which is incremented every time the kstat chain changes, to the
35 user's KCID, \fIkc\fR->\fBkc_chain_id\fR. If the KCIDs match,
36 \fBkstat_chain_update()\fR does nothing. Otherwise, it deletes any invalid
37 kstat headers from the user's kstat chain, adds any new ones, and sets
38 \fIkc\fR->\fBkc_chain_id\fR to the new KCID. All other kstat headers in the
39 user's kstat chain are unmodified.
43 Upon successful completion, \fBkstat_chain_update()\fR returns the new KCID if
44 the kstat chain has changed and 0 if it has not changed. Otherwise, it returns
45 \(mi1 and sets \fBerrno\fR to indicate the error.
49 The \fBkstat_chain_update()\fR function will fail if:
56 The kstat was temporarily unavailable for reading or writing.
65 Insufficient storage space is available.
74 The given kstat could not be located for reading.
83 The data for the given kstat was too large to be stored in the structure.
90 \fB\fB/dev/kstat\fR\fR
93 kernel statistics driver
99 See \fBattributes\fR(5) for descriptions of the following attributes:
107 ATTRIBUTE TYPE ATTRIBUTE VALUE
109 Interface Stability Stable
117 \fBkstat\fR(3KSTAT), \fBkstat_lookup\fR(3KSTAT), \fBkstat_open\fR(3KSTAT),
118 \fBkstat_read\fR(3KSTAT), \fBattributes\fR(5)