From 6cd102f0d7434947f25561ffc03c1c678bfa9d02 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 4 Jan 2006 23:01:45 +0000 Subject: [PATCH] port sysctl version of swap_get to freebsd4 --- src/os/darwin/darwin_sigar.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 5dd477cd..bf691130 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -288,7 +288,18 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) #define SWI_MAXMIB 3 -#ifdef SIGAR_FREEBSD5 +#ifndef XSWDEV_VERSION +#define XSWDEV_VERSION 1 +struct xswdev { + u_int xsw_version; + udev_t xsw_dev; + int xsw_flags; + int xsw_nblks; + int xsw_used; +}; +#endif + +#ifdef __FreeBSD__ /* code in this function is based on FreeBSD 5.3 kvm_getswapinfo.c */ static int getswapinfo_sysctl(struct kvm_swap *swap_ary, int swap_max) @@ -354,8 +365,6 @@ static int getswapinfo_sysctl(struct kvm_swap *swap_ary, return SIGAR_OK; } -#else -#define getswapinfo_sysctl(swap_ary, swap_max) SIGAR_ENOTIMPL #endif int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap)