35 |
|
#endif |
36 |
|
|
37 |
|
#ifdef LINUX |
38 |
+ |
#include <time.h> |
39 |
|
#include <sys/vfs.h> |
40 |
|
#include <mntent.h> |
41 |
|
#include "tools.h" |
42 |
< |
#define VALID_FS_TYPES {"ext2", "ext3", "xfs", "reiserfs", "vfat", "tmpfs"} |
42 |
> |
#define VALID_FS_TYPES {"adfs", "affs", "befs", "bfs", "efs", "ext2", \ |
43 |
> |
"ext3", "vxfs", "hfs", "hfsplus", "hpfs", "jffs", \ |
44 |
> |
"jffs2", "minix", "msdos", "ntfs", "qnx4", "ramfs", \ |
45 |
> |
"rootfs", "reiserfs", "sysv", "v7", "udf", "ufs", \ |
46 |
> |
"umsdos", "vfat", "xfs", "jfs"} |
47 |
|
#endif |
48 |
|
|
49 |
< |
#ifdef FREEBSD |
49 |
> |
#ifdef ALLBSD |
50 |
|
#include <sys/param.h> |
51 |
|
#include <sys/ucred.h> |
52 |
|
#include <sys/mount.h> |
53 |
+ |
#define VALID_FS_TYPES {"ufs", "mfs", "ffs"} |
54 |
+ |
#endif |
55 |
+ |
#ifdef FREEBSD |
56 |
|
#include <sys/dkstat.h> |
57 |
|
#include <devstat.h> |
50 |
– |
#define VALID_FS_TYPES {"ufs", "mfs"} |
58 |
|
#endif |
59 |
+ |
|
60 |
|
#define START_VAL 1 |
61 |
|
|
62 |
|
char *copy_string(char *orig_ptr, const char *newtext){ |
105 |
|
struct mntent *mp; |
106 |
|
struct statfs fs; |
107 |
|
#endif |
108 |
< |
#ifdef FREEBSD |
108 |
> |
#ifdef ALLBSD |
109 |
|
int nummnt; |
110 |
|
struct statfs *mp; |
111 |
|
#endif |
118 |
|
watermark=START_VAL; |
119 |
|
init_disk_stat(0, watermark-1, disk_stats); |
120 |
|
} |
121 |
< |
#ifdef FREEBSD |
121 |
> |
#ifdef ALLBSD |
122 |
|
nummnt=getmntinfo(&mp , MNT_LOCAL); |
123 |
|
if (nummnt<=0){ |
124 |
|
return NULL; |
182 |
|
} |
183 |
|
|
184 |
|
disk_ptr=disk_stats+num_disks; |
185 |
< |
#ifdef FREEBSD |
185 |
> |
#ifdef ALLBSD |
186 |
|
if((disk_ptr->device_name=copy_string(disk_ptr->device_name, mp->f_mntfromname))==NULL){ |
187 |
|
return NULL; |
188 |
|
} |
341 |
|
long sel_gen; |
342 |
|
struct devstat *dev_ptr; |
343 |
|
#endif |
344 |
+ |
#ifdef NETBSD |
345 |
+ |
/* FIXME get_diskio_stats NYI on NetBSD. |
346 |
+ |
* See vmstat/dkstats.c in NetBSD source for examples. |
347 |
+ |
*/ |
348 |
+ |
#endif |
349 |
|
num_diskio=0; |
350 |
|
|
351 |
|
#ifdef FREEBSD |
352 |
|
if (!stats_init) { |
353 |
|
stats.dinfo=malloc(sizeof(struct devinfo)); |
341 |
– |
bzero(stats.dinfo, sizeof(struct devinfo)); |
354 |
|
if(stats.dinfo==NULL) return NULL; |
355 |
+ |
bzero(stats.dinfo, sizeof(struct devinfo)); |
356 |
|
stats_init = 1; |
357 |
|
} |
358 |
|
#ifdef FREEBSD5 |