Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

kstat2_set_v1_names (9F)

Name

kstat2_set_v1_names - initialize metadata for v2 kstats published as v1

Synopsis

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

int kstat2_set_v1_names(kstat2_t *ksp, const char *class,
     const char *module, const char *name, int instance)

Interface Level

Solaris DDI specific (Solaris DDI)

Parameters

ksp

Pointer to v2 kstat.

class

Null-terminated string representing the v1 kstat's class.

module

Null-terminated string representing the v1 kstat's module.

name

Null terminated string representing the v1 kstat's name. This can also be NULL.

instance

Integer representing the driver instance.

Description

The kstat2_set_v1_names() function is used to initialize the v1 kstat naming fields in a v2 kstat. This is used when converting an existing v1 kstat to v2 to ensure that v1 clients continue to see the same values in the kstat as they did prior to conversion.

Kstats which are new to v2 should not use this function as they do not need to be published as v1 kstats.

If the name field is NULL, it will be constructed from a concatenation of the module and instance fields as is done in kstat_create(9F) function. This functionality is provided for backward compatibility for those drivers which have traditionally supplied a NULL ks_name parameter to kstat_create(9F).

Return Values

0

on success

-1

if class or module names are NULL, or if the class, module, or name fields including terminating NULL exceed KSTAT_STRLEN characters.

Context

The kstat2_set_v1_names() function can be called from user or kernel context.

See Also

kstat2_create(9F), kstat_create(9F), kstat(9S), kstat2(9S)