# endif
/* #endif KERNEL_LINUX */
-#elif HAVE_KVM_H
+#elif HAVE_LIBKVM_GETPROCS
# include <kvm.h>
# include <sys/user.h>
# include <sys/proc.h>
# if HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
# endif
-/* #endif HAVE_KVM_H */
+/* #endif HAVE_LIBKVM_GETPROCS */
#else
# error "No applicable input method."
static const char *config_keys[] =
{
"Process",
- "ProcessMatch",
- NULL
+ "ProcessMatch"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
#elif KERNEL_LINUX
static long pagesize_g;
-#endif /* KERNEL_LINUX */
+/* #endif KERNEL_LINUX */
+
+#elif HAVE_LIBKVM_GETPROCS
+/* no global variables */
+#endif /* HAVE_LIBKVM_GETPROCS */
/* put name of process from config to list_head_g tree
list_head_g is a list of 'procstat_t' structs with
pagesize_g = sysconf(_SC_PAGESIZE);
DEBUG ("pagesize_g = %li; CONFIG_HZ = %i;",
pagesize_g, CONFIG_HZ);
-#endif /* KERNEL_LINUX */
+/* #endif KERNEL_LINUX */
+
+#elif HAVE_LIBKVM_GETPROCS
+/* no initialization */
+#endif /* HAVE_LIBKVM_GETPROCS */
return (0);
} /* int ps_init */
* There's only zombie tasks, which are
* handled above. */
default:
- WARNING ("Unknown thread status: %s",
+ WARNING ("Unknown thread status: %i",
thread_data.run_state);
break;
} /* switch (thread_data.run_state) */
ps_submit_proc_list (ps_ptr);
/* #endif KERNEL_LINUX */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETPROCS
int running = 0;
int sleeping = 0;
int zombies = 0;
for (ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
ps_submit_proc_list (ps_ptr);
-#endif /* HAVE_LIBKVM */
+#endif /* HAVE_LIBKVM_GETPROCS */
return (0);
} /* int ps_read */