Interface Level

Parameters

The type of value. This indicates which field of the kstat_named(9S) structure should be used. Valid values are:

KSTAT_DATA_CHAR

The “char” field.

KSTAT_DATA_LONG

The “long” field.

KSTAT_DATA_ULONG

The “unsigned long” field.

KSTAT_DATA_LONGLONG

Obsolete. Use KSTAT_DATA_INT64.

KSTAT_DATA_ULONGLONG

Obsolete. Use KSTAT_DATA_UINT64.

KSTAT_DATA_STRING

Arbitrary length “long string” field.

str

Pointer to a NULL-terminated string.

Description

kstat_named_init() associates a name and a type with a kstat_named(9S) structure.

kstat_named_setstr() associates str with the named kstat knp. It is an error
for knp to be of type other than KSTAT_DATA_STRING. The string argument
must remain valid even after the function that is calling kstat_named_setstr() is returned.
This is the only supported method of changing the value of long
strings.

Return Values

None.

Context

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