4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1992 by Sun Microsystems, Inc.
24 * Copyright 2021 Oxide Computer Company
30 #include <sys/types.h>
31 #include <sys/kstat.h>
38 * kstat_open() returns a pointer to a kstat_ctl_t.
39 * This is used for subsequent libkstat operations.
41 typedef struct kstat_ctl
{
42 kid_t kc_chain_id
; /* current kstat chain ID */
43 kstat_t
*kc_chain
; /* pointer to kstat chain */
44 int kc_kd
; /* /dev/kstat descriptor */
47 extern kstat_ctl_t
*kstat_open(void);
48 extern int kstat_close(kstat_ctl_t
*);
49 extern kid_t
kstat_read(kstat_ctl_t
*, kstat_t
*, void *);
50 extern kid_t
kstat_write(kstat_ctl_t
*, kstat_t
*, void *);
51 extern kid_t
kstat_chain_update(kstat_ctl_t
*);
52 extern kstat_t
*kstat_lookup(kstat_ctl_t
*, const char *, int,
54 extern void *kstat_data_lookup(kstat_t
*, const char *);