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.52 by tdb, Fri Feb 13 16:46:21 2004 UTC vs.
Revision 1.54 by ats, Fri Mar 19 23:44:30 2004 UTC

# Line 61 | Line 61
61   #include <sys/ucred.h>
62   #include <sys/mount.h>
63   #endif
64 < #ifdef FREEBSD
64 > #if defined(FREEBSD) || defined(DFBSD)
65   #include <sys/dkstat.h>
66   #include <devstat.h>
67   #define VALID_FS_TYPES {"hpfs", "msdosfs", "ntfs", "udf", "ext2fs", \
# Line 349 | Line 349 | diskio_stat_t *get_diskio_stats(int *entries){
349          time_t now;
350          const char *format;
351   #endif
352 < #ifdef FREEBSD
352 > #if defined(FREEBSD) || defined(DFBSD)
353          static struct statinfo stats;
354          static int stats_init = 0;
355          int counter;
# Line 489 | Line 489 | diskio_stat_t *get_diskio_stats(int *entries){
489   #endif
490   #endif
491  
492 < #ifdef FREEBSD
492 > #if defined(FREEBSD) || defined(DFBSD)
493          if (!stats_init) {
494                  stats.dinfo=malloc(sizeof(struct devinfo));
495                  if(stats.dinfo==NULL) return NULL;
# Line 590 | Line 590 | diskio_stat_t *get_diskio_stats(int *entries){
590             the same format. */
591  
592          f = fopen("/proc/diskstats", "r");
593 <        format = " %d %d %19s %*d %*d %lld %*d %*d %*d %lld";
593 >        format = " %d %d %99s %*d %*d %lld %*d %*d %*d %lld";
594          if (f == NULL) {
595                  f = fopen("/proc/partitions", "r");
596 <                format = " %d %d %*d %19s %*d %*d %lld %*d %*d %*d %lld";
596 >                format = " %d %d %*d %99s %*d %*d %lld %*d %*d %*d %lld";
597          }
598          if (f == NULL) goto out;
599          now = time(NULL);
600  
601          while ((line_ptr = f_read_line(f, "")) != NULL) {
602 <                char name[20];
602 >                char name[100];
603                  char *s;
604                  long long rsect, wsect;
605  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines