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

Comparing projects/libstatgrab/src/libstatgrab/disk_stats.c (file contents):
Revision 1.30 by ats, Sun Oct 19 00:10:30 2003 UTC vs.
Revision 1.31 by ats, Sun Oct 19 02:03:02 2003 UTC

# Line 42 | Line 42
42   #define VALID_FS_TYPES {"ext2", "ext3", "xfs", "reiserfs", "vfat", "tmpfs"}
43   #endif
44  
45 < #ifdef FREEBSD
45 > #ifdef ALLBSD
46   #include <sys/param.h>
47   #include <sys/ucred.h>
48   #include <sys/mount.h>
49 + #define VALID_FS_TYPES {"ufs", "mfs", "ffs"}
50 + #endif
51 + #ifdef FREEBSD
52   #include <sys/dkstat.h>
53   #include <devstat.h>
51 #define VALID_FS_TYPES {"ufs", "mfs"}
54   #endif
55 +
56   #define START_VAL 1
57  
58   char *copy_string(char *orig_ptr, const char *newtext){
# Line 98 | Line 101 | disk_stat_t *get_disk_stats(int *entries){
101          struct mntent *mp;
102          struct statfs fs;
103   #endif
104 < #ifdef FREEBSD
104 > #ifdef ALLBSD
105          int nummnt;
106          struct statfs *mp;
107   #endif
# Line 111 | Line 114 | disk_stat_t *get_disk_stats(int *entries){
114                  watermark=START_VAL;
115                  init_disk_stat(0, watermark-1, disk_stats);
116          }
117 < #ifdef FREEBSD
117 > #ifdef ALLBSD
118          nummnt=getmntinfo(&mp , MNT_LOCAL);
119          if (nummnt<=0){
120                  return NULL;
# Line 175 | Line 178 | disk_stat_t *get_disk_stats(int *entries){
178                          }
179  
180                          disk_ptr=disk_stats+num_disks;
181 < #ifdef FREEBSD
181 > #ifdef ALLBSD
182                          if((disk_ptr->device_name=copy_string(disk_ptr->device_name, mp->f_mntfromname))==NULL){
183                                  return NULL;
184                          }
# Line 333 | Line 336 | diskio_stat_t *get_diskio_stats(int *entries){
336          int n_selected, n_selections;
337          long sel_gen;
338          struct devstat *dev_ptr;
339 + #endif
340 + #ifdef NETBSD
341 +        /* FIXME get_diskio_stats NYI on NetBSD.
342 +         * See vmstat/dkstats.c in NetBSD source for examples.
343 +         */
344   #endif
345          num_diskio=0;
346  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines