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_OPEN 3KSTAT "Aug 3, 2004"
8 kstat_open, kstat_close \- initialize kernel statistics facility
12 \fBcc\fR[ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lkstat\fR [ \fIlibrary\fR\&.\|.\|.]
15 \fBkstat_ctl_t *\fR\fBkstat_open\fR(\fB\fR\fIvoid\fR);
20 \fBint\fR \fBkstat_close\fR(\fBkstat_ctl_t *\fR\fIkc\fR);
26 The \fBkstat_open()\fR function initializes a kstat control structure that
27 provides access to the kernel statistics library. It returns a pointer to this
28 structure, which must be supplied as the \fIkc\fR argument in subsequent
29 \fBlibkstat\fR function calls.
32 The \fBkstat_close()\fR function frees all resources that were associated with
33 \fIkc\fR. This is performed automatically on \fBexit\fR(2) and \fBexecve\fR(2).
37 Upon successful completion, \fBkstat_open()\fR returns a pointer to a kstat
38 control structure. Otherwise, it returns \fINULL\fR, no resources are
39 allocated, and \fBerrno\fR is set to indicate the error.
42 Upon successful completion, \fBkstat_close()\fR returns 0. Otherwise, \(mi1 is
43 returned and \fBerrno\fR is set to indicate the error.
47 The \fBkstat_open()\fR function will fail if:
54 Insufficient storage space is available.
63 The kstat was temporarily unavailable for reading or writing.
72 The given kstat could not be located for reading.
81 The data for the given kstat was too large to be stored in the structure.
86 The \fBkstat_open()\fR function can also return the error values for
90 The \fBkstat_close()\fR function can also return the error values for
96 \fB\fB/dev/kstat\fR\fR
99 kernel statistics driver
105 See \fBattributes\fR(5) for descriptions of the following attributes:
113 ATTRIBUTE TYPE ATTRIBUTE VALUE
115 Interface Stability Stable
123 \fBclose\fR(2), \fBexecve\fR(2), \fBopen\fR(2), \fBexit\fR(2),
124 \fBkstat\fR(3KSTAT), \fBkstat_chain_update\fR(3KSTAT),
125 \fBkstat_lookup\fR(3KSTAT), \fBkstat_read\fR(3KSTAT), \fBattributes\fR(5)