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

Comparing projects/libstatgrab/src/libstatgrab/process_stats.c (file contents):
Revision 1.39 by ats, Sun Apr 4 21:42:44 2004 UTC vs.
Revision 1.41 by tdb, Sun Apr 4 21:54:49 2004 UTC

# Line 61 | Line 61
61   #include <paths.h>
62   #include <fcntl.h>
63   #include <limits.h>
64 + #if (defined(FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD)
65   #include <kvm.h>
66   #endif
67 + #include <unistd.h>
68 + #endif
69  
70   int get_proc_snapshot(proc_state_t **ps){
71          proc_state_t *proc_state = NULL;
# Line 72 | Line 75 | int get_proc_snapshot(proc_state_t **ps){
75          int mib[4];
76          size_t size;
77          struct kinfo_proc *kp_stats;
78 <        int procs, i, alloc;
78 >        int procs, i;
79          char *proctitle;
80 < #if defined(FREEBSD5) || defined(NETBSD) || defined(OPENBSD)
78 <        long buflen;
79 <        char *p;
80 <        int argc;
81 <        int j = 0;
82 < #else
80 > #if (defined(FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD)
81          static kvm_t *kvmd;
82          char **args;
83 +        int alloc;
84 + #else
85 +        long buflen;
86 +        char *p;
87   #endif
88   #endif
89   #if defined(SOLARIS) || defined(LINUX)
# Line 470 | Line 472 | process_stat_t *get_process_stats() {
472  
473          for(x = 0; x < ps_size; x++) {
474                  switch (ps->state) {
473                /* currently no mapping for UNKNOWN in process_stat_t */
475                  case RUNNING:
476                          process_stat.running++;
477                          break;
# Line 482 | Line 483 | process_stat_t *get_process_stats() {
483                          break;
484                  case ZOMBIE:
485                          process_stat.zombie++;
486 +                        break;
487 +                default:
488 +                        /* currently no mapping for UNKNOWN in process_stat_t */
489                          break;
490                  }
491                  ps++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines