16602 usba: unused label
[illumos-gate.git] / usr / src / lib / libkstat / kstat.h
blob4996a4d1539a3081115c4f1e106672b07a52edba
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright (c) 1992 by Sun Microsystems, Inc.
24 * Copyright 2021 Oxide Computer Company
27 #ifndef _KSTAT_H
28 #define _KSTAT_H
30 #include <sys/types.h>
31 #include <sys/kstat.h>
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
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 */
45 } kstat_ctl_t;
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,
53 const char *);
54 extern void *kstat_data_lookup(kstat_t *, const char *);
56 #ifdef __cplusplus
58 #endif
60 #endif /* _KSTAT_H */