# ifndef CONFIG_HZ
# define CONFIG_HZ 100
# endif
-#endif /* KERNEL_LINUX */
-
-#define MODULE_NAME "processes"
+/* #endif KERNEL_LINUX */
-#if HAVE_THREAD_INFO || KERNEL_LINUX
-# define PROCESSES_HAVE_READ 1
#else
-# define PROCESSES_HAVE_READ 0
+# error "No applicable input method."
#endif
#define BUFSIZE 256
-#if PROCESSES_HAVE_READ
-#if HAVE_THREAD_INFO | KERNEL_LINUX
static const char *config_keys[] =
{
"Process",
NULL
};
static int config_keys_num = 1;
-#endif
typedef struct procstat_entry_s
{
struct procstat_entry_s *instances;
} procstat_t;
-#if HAVE_THREAD_INFO | KERNEL_LINUX
static procstat_t *list_head_g = NULL;
-#endif
#if HAVE_THREAD_INFO
static mach_port_t port_host_self;
static long pagesize_g;
#endif /* KERNEL_LINUX */
-#if HAVE_THREAD_INFO | KERNEL_LINUX
static void ps_list_register (const char *name)
{
procstat_t *new;
return (0);
}
-#endif /* HAVE_THREAD_INFO | KERNEL_LINUX */
static int ps_init (void)
{
closedir (dh);
+ if (list_len == 0)
+ return (NULL);
+
assert (list_len < list_size);
assert (list[list_len] == 0);
return (list);
-}
+} /* int *ps_read_tasks */
int ps_read_process (int pid, procstat_t *ps, char *state)
{
return (0);
} /* int ps_read */
-#endif /* PROCESSES_HAVE_READ */
void module_register (void)
{
-#if PROCESSES_HAVE_READ
-#if HAVE_THREAD_INFO | KERNEL_LINUX
plugin_register_config ("processes", ps_config,
config_keys, config_keys_num);
-#endif
plugin_register_init ("processes", ps_init);
plugin_register_read ("processes", ps_read);
-#endif /* PROCESSES_HAVE_READ */
} /* void module_register */