Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

kstat2_nv_setstrs (9F)

Name

kstat2_nv_setstr, kstat2_nv_setstrs, kstat2_nv_setints - set a string or array kstat value

Synopsis

#include <sys/types.h>
#include <sys/kstat2.h>

void kstat2_nv_setstr(kstat2_named_t *knp, char *str)

void kstat2_nv_setstrs(kstat2_named_t *knp,
     kstat2_named_str_t *arr, uint32_t len);

void kstat2_nv_setints(kstat2_named_t *knp,
     uint64_t *arr, uint32_t len);

Interface Level

Solaris DDI specific (Solaris DDI)

Parameters

knp

Pointer to storage for a kstat2 name-value pair.

kstat2_nv_setstr()

str

Null-terminated character string which is the value for this name-value pair. NULL and empty string are acceptable values. A string can be up to 2^16-1 characters in length, including the NULL.

kstat2_nv_setstrs() and kstat2_nv_setints()

arr

Array of kstat2_named_str_t or uint64_t which is the value for this name-value pair.

len

Number of strings or integers in the array. Arrays can have up to 2^32-1 elements.

Description

The kstat2_nv_setstr() function is used to set a string value on a given kstat name-value pair structure.

The kstat2_nv_setstrs() function is used to set a string array on a given kstat name-value pair structure. If the supplied value for arr is NULL, the internal array length is set to zero.

The kstat2_nv_setints() function is used to set an integer array on a given kstat name-value pair structure. If the supplied value for arr is NULL, the internal array length is set to zero.

Return Values

None

Context

These functions can be called from any context.

See Also

kstat2_nv_init(9F), kstat2(9S), kstat2_named(9S)

Notes

Before calling the functions, the kstat2_named(9S) structure should have its type set appropriately to one of the following: KSTAT2_NVVT_STR, KSTAT2_NVVT_STRS, KSTAT2_NVVT_INTS.