xref: /titanic_50/usr/src/lib/libkstat/kstat.h (revision 936b7af69172dce89b577831f79c0e18d15e854b)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1992 by Sun Microsystems, Inc.
24  */
25 
26 #ifndef	_KSTAT_H
27 #define	_KSTAT_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/types.h>
32 #include <sys/kstat.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * kstat_open() returns a pointer to a kstat_ctl_t.
40  * This is used for subsequent libkstat operations.
41  */
42 typedef struct kstat_ctl {
43 	kid_t	kc_chain_id;	/* current kstat chain ID	*/
44 	kstat_t	*kc_chain;	/* pointer to kstat chain	*/
45 	int	kc_kd;		/* /dev/kstat descriptor	*/
46 } kstat_ctl_t;
47 
48 #ifdef	__STDC__
49 extern	kstat_ctl_t	*kstat_open(void);
50 extern	int		kstat_close(kstat_ctl_t *);
51 extern	kid_t		kstat_read(kstat_ctl_t *, kstat_t *, void *);
52 extern	kid_t		kstat_write(kstat_ctl_t *, kstat_t *, void *);
53 extern	kid_t		kstat_chain_update(kstat_ctl_t *);
54 extern	kstat_t		*kstat_lookup(kstat_ctl_t *, char *, int, char *);
55 extern	void		*kstat_data_lookup(kstat_t *, char *);
56 #else
57 extern	kstat_ctl_t	*kstat_open();
58 extern	int		kstat_close();
59 extern	kid_t		kstat_read();
60 extern	kid_t		kstat_write();
61 extern	kid_t		kstat_chain_update();
62 extern	kstat_t		*kstat_lookup();
63 extern	void		*kstat_data_lookup();
64 #endif
65 
66 #ifdef	__cplusplus
67 }
68 #endif
69 
70 #endif	/* _KSTAT_H */
71