kstat2_data_size - calculate the total size required for a v2 kstat's data
#include <sys/types.h> #include <sys/kstat2.h> size_t kstat2_data_size(kstat2_named_t *knp, uint_t ndata);
Solaris DDI specific (Solaris DDI)
Pointer to the first element in an array of kstat values (kvals).
Number of kvals in the array.
kstat2_data_size() function calculates the total amount of space in bytes, that is required to hold all of the kvals, their null terminated names, and any string or array values. Typically this might be called from a custom kstat_update() function and its return value is used to set the ks2_data_size field in the kstat2(9S) data-structure.
The kstat2_data_size() function returns the amount of storage, in bytes, required to hold all of the kvals, their names and any variable values such as strings or arrays.
The kstat2_data_size() function can be called from any context.