Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Thursday, June 13, 2019

kstat2_zone_remove (9F)


kstat2_zone_add, kstat2_zone_remove - add or remove visibility of a kstat in a zone


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

void kstat2_zone_add(kstat2_t *ksp, zoneid_t zone);
void kstat2_zone_remove(kstat2_t *ksp, zoneid_t zone);

Interface Level

Solaris DDI specific (Solaris DDI)



Pointer to a currently installed kstat2(9S) structure.


ID of the zone in which the kstat is to be made visible or hidden.


The kstat2_zone_add() function marks the specified kstat as visible in the given zone. Subsequent readings of kstats in this zone will include the kstat.

The kstat2_zone_remove() function prevents the specified kstat from being visible or read in the given zone.

The macros: ALL_ZONES and GLOBAL_ZONEID, can be used as the zone parameter to both functions. ALL_ZONES indicates that the kstat is visible in all global and non-global zones. GLOBAL_ZONEID indicates that the kstat can only be read in the global zone.

A kstat is made visible in both the global zone and a non-global zone at the creation time, by passing the KSTAT2_FLAG_GZ_VIS flag in the ks_flags argument and the non-global zone id in the ks_zone argument. For more information, see the kstat2_create(9F) man page.

Return Values



The kstat zone functions can be called from any context.

See Also

kstat2_create(9F), kstat2_install(9F), kstat2(9S)