ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/cpu_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/cpu_stats.c (file contents):
Revision 1.1 by pajs, Tue Feb 18 19:28:30 2003 UTC vs.
Revision 1.4 by tdb, Fri Feb 28 22:59:35 2003 UTC

# Line 23 | Line 23
23   #endif
24  
25   #include <stdio.h>
26 #include <ukcprog.h>
26   #include <unistd.h>
27   #include <stdlib.h>
29 #include <sys/types.h>
28   #include <time.h>
29   #include <string.h>
30   #include "statgrab.h"
# Line 34 | Line 32
32   #include <kstat.h>
33   #include <sys/sysinfo.h>
34   #endif
37 #ifdef FREEBSD
38 #include <sys/sysctl.h>
39 #include <sys/dkstat.h>
40 #endif
35  
36   static cpu_states_t cpu_now;
37   static int cpu_now_uninit=1;
38  
45
39   cpu_states_t *get_cpu_totals(){
40  
41   #ifdef SOLARIS
# Line 77 | Line 70 | cpu_states_t *get_cpu_totals(){
70          cpu_now.total=cpu_now.user+cpu_now.iowait+cpu_now.kernel+cpu_now.idle+cpu_now.swap;
71          cpu_now_uninit=0;
72  
73 <        if((kstat_close(kc)) != 0){
81 <                return NULL;
82 <        }
83 <
73 >        kstat_close(kc);
74   #endif
75  
76          cpu_now.systime=time(NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines