1kstat_named_init(9F)     Kernel Functions for Drivers     kstat_named_init(9F)
2
3
4

NAME

6       kstat_named_init, kstat_named_setstr - initialize a named kstat
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <sys/kstat.h>
11
12
13
14       void kstat_named_init(kstat_named_t *knp, const char *name,
15            uchar_t data_type);
16
17
18       void kstat_named_setstr(kstat_named_t *knp, const char *str);
19
20

INTERFACE LEVEL

22       Solaris DDI specific (Solaris DDI)
23

PARAMETERS

25       knp          Pointer to a kstat_named(9S) structure.
26
27
28       name         The name of the statistic.
29
30
31       data_type    The  type  of  value.  This  indicates  which field of the
32                    kstat_named(9S) structure should  be  used.  Valid  values
33                    are:
34
35                    KSTAT_DATA_CHAR         The "char" field.
36
37
38                    KSTAT_DATA_LONG         The "long" field.
39
40
41                    KSTAT_DATA_ULONG        The "unsigned long" field.
42
43
44                    KSTAT_DATA_LONGLONG     Obsolete. Use KSTAT_DATA_INT64.
45
46
47                    KSTAT_DATA_ULONGLONG    Obsolete. Use KSTAT_DATA_UINT64.
48
49
50                    KSTAT_DATA_STRING       Arbitrary   length  "long  string"
51                                            field.
52
53
54
55       str          Pointer to a NULL-terminated string.
56
57

DESCRIPTION

59       kstat_named_init() associates a name and a type with a  kstat_named(9S)
60       structure.
61
62
63       kstat_named_setstr()  associates str with the named kstat knp. It is an
64       error for knp to be of type other than  KSTAT_DATA_STRING.  The  string
65       argument  must  remain  valid  even  after the function that is calling
66       kstat_named_setstr() is returned. This is the only supported method  of
67       changing the value of long strings.
68

RETURN VALUES

70       None.
71

CONTEXT

73       kstat_named_init()  and kstat_named_setstr() can be called from user or
74       kernel context.
75

SEE ALSO

77       kstat_create(9F), kstat_install(9F), kstat(9S), kstat_named(9S)
78
79
80       Writing Device Drivers
81
82
83
84SunOS 5.11                        29 Feb 2008             kstat_named_init(9F)
Impressum