swap module: Include <vm/anon.h> on Solaris.
[collectd.git] / src / swap.c
index f9debc1..11c9c57 100644 (file)
@@ -26,6 +26,9 @@
 #if HAVE_SYS_SWAP_H
 # include <sys/swap.h>
 #endif
+#if HAVE_VM_ANON_H
+# include <vm/anon.h>
+#endif
 #if HAVE_SYS_PARAM_H
 #  include <sys/param.h>
 #endif
@@ -56,10 +59,10 @@ static kstat_t *ksp;
 /* No global variables */
 /* #endif defined(VM_SWAPUSAGE) */
 
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
 static kvm_t *kvm_obj = NULL;
 int kvm_pagesize;
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
 
 #elif HAVE_LIBSTATGRAB
 /* No global variables */
@@ -86,7 +89,7 @@ static int swap_init (void)
        /* No init stuff */
 /* #endif defined(VM_SWAPUSAGE) */
 
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
        if (kvm_obj != NULL)
        {
                kvm_close (kvm_obj);
@@ -105,7 +108,7 @@ static int swap_init (void)
                ERROR ("swap plugin: kvm_open failed.");
                return (-1);
        }
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
 
 #elif HAVE_LIBSTATGRAB
        /* No init stuff */
@@ -260,7 +263,7 @@ static int swap_read (void)
        swap_submit ("free", sw_usage.xsu_avail);
 /* #endif VM_SWAPUSAGE */
 
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
        struct kvm_swap data_s;
        int             status;
 
@@ -286,7 +289,7 @@ static int swap_read (void)
 
        swap_submit ("used", used);
        swap_submit ("free", free);
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
 
 #elif HAVE_LIBSTATGRAB
        sg_swap_stats *swap;