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.27 by pajs, Thu Oct 9 14:59:52 2003 UTC vs.
Revision 1.30 by ats, Sun Oct 19 00:10:30 2003 UTC

# Line 35 | Line 35
35   #endif
36  
37   #ifdef LINUX
38 + #include <time.h>
39   #include <sys/vfs.h>
40   #include <mntent.h>
41   #include "tools.h"
# Line 342 | Line 343 | diskio_stat_t *get_diskio_stats(int *entries){
343                  if(stats.dinfo==NULL) return NULL;
344                  stats_init = 1;
345          }
346 <        if ((getdevs(&stats)) < 0) return NULL;
346 > #ifdef FREEBSD5
347 >        if ((devstat_getdevs(NULL, &stats)) < 0) return NULL;
348          /* Not aware of a get all devices, so i said 999. If we ever
349           * find a machine with more than 999 disks, then i'll change
350           * this number :)
351           */
352 < #ifdef FREEBSD5
351 <        if ((devstat_getdevs(NULL, &stats)) < 0) return NULL;
352 >        if (devstat_selectdevs(&dev_sel, &n_selected, &n_selections, &sel_gen, stats.dinfo->generation, stats.dinfo->devices, stats.dinfo->numdevs, NULL, 0, NULL, 0, DS_SELECT_ONLY, 999, 1) < 0) return NULL;
353   #else
354 +        if ((getdevs(&stats)) < 0) return NULL;
355 +        /* Not aware of a get all devices, so i said 999. If we ever
356 +         * find a machine with more than 999 disks, then i'll change
357 +         * this number :)
358 +         */
359          if (selectdevs(&dev_sel, &n_selected, &n_selections, &sel_gen, stats.dinfo->generation, stats.dinfo->devices, stats.dinfo->numdevs, NULL, 0, NULL, 0, DS_SELECT_ONLY, 999, 1) < 0) return NULL;
360   #endif
361  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines