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", \ |
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; |
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; |
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 |
|
|