MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers                    kstatinstall(9F)



NAME
     kstatinstall - add a fully initialized kstat to the system

SYNOPSIS
     #include 
     #include 



     void kstatinstall(kstatt *ksp);


INTERFACE LEVEL
     Solaris DI specific (Solaris DI)

PARAMETERS
     ksp    Pointer to a fully initialized kstat(9S) structure.


DESCRIPTION
     kstatinstall() is used in conjunction with kstatcreate(9F)
     to allocate and initialize a kstat(9S) structure.


     After a successful call to kstatcreate()  the  driver  must
     perform  any  necessary  initialization  of the data section
     (such as  setting  the  name  fields  in  a  kstat  of  type
     KSTATYPENAMED).  Virtual  kstats  must  have the  ksdata
     field set at this  time.  The  provider  may  also  set  the
     ksupdate, ksprivate, and kslock fields if necessary.


     Once the kstat is completely initialized,  kstatinstall  is
     used to make the kstat accessible to the outside world.

RETURN VALUES
     None.

CONTEXT
     kstatinstall() can be called from user or kernel context.

EXAMPLES
     Example 1 Allocating and Initializing a kstat Structure


     The method for allocating and initializing a kstat structure
     is generally as follows:


       kstatt *ksp;
       ksp = kstatcreate(module, instance, name, class, type, ndata, flags);
       if (ksp) {



SunOS 5.11          Last change: 26 May 1994                    1






Kernel Functions for Drivers                    kstatinstall(9F)



                /* ... provider initialization, if necessary */
                 kstatinstall(ksp);
       }


SEE ALSO
     kstatcreate(9F),  kstatdelete(9F),   kstatnamedinit(9F),
     kstat(9S)


     Writing Device Drivers












































SunOS 5.11          Last change: 26 May 1994                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™