kstat library in Solaris

kstat library in Solaris

Post by Kalyan Jayarama » Sat, 28 Nov 1998 04:00:00



Hi,
I wrote a small program using the "kstat" library of Solaris.  I
compiled it with Purify - and Purify is reporting me some strange UMRs (
UnInitialised Memory Reads ) in kstat_open( )  and kstat_lookup( )
calls..  I want to know whether it is due to some problem with my code.

My code was something like this:

#include <kstat.h>

int  DoSomeThing( )
{
      kstat_ctl_t *kc = NULL ;
      kstat_t *ksp = NULL ;
      kstat_named_t *ksn ;

      kc = kstat_open( ) ;   //  2 UMRs are reported here !!

      if  ( kc == NULL )  {
          // do appropriate error handling
         return -1 ;
     }

      ksp = kstat_lookup(kc, "unix", 0, "system_misc");    // 145 UMRs
reported here !!!!

      if ( ksp == NULL )  {
         // do appropriate error handling
         return -1 ;
    }

    // Here I proceed with my operation.....
    ...
    ...
    ...
    ...

Quote:}

 I am getting the results properly though.  How do I eliminate these
UMRs  ?

 Thanks a lot

 Cheers,
Kalyan