From 0eeded8bc013857a5e8a2efbc20002a22502897e Mon Sep 17 00:00:00 2001 From: Scott Tincman Date: Tue, 13 Nov 2012 20:29:55 -0500 Subject: DragonFlyBSD support added --- src/print_cpu_usage.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/print_cpu_usage.c') diff --git a/src/print_cpu_usage.c b/src/print_cpu_usage.c index ed17db3..ecc81a2 100644 --- a/src/print_cpu_usage.c +++ b/src/print_cpu_usage.c @@ -13,6 +13,13 @@ #include #endif +#if defined(__DragonFly__) +#include +#include +#include +#include +#endif + #include "i3status.h" static int prev_total = 0; @@ -43,9 +50,9 @@ void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format) { diff_usage = (diff_total ? (1000 * (diff_total - diff_idle)/diff_total + 5)/10 : 0); prev_total = curr_total; prev_idle = curr_idle; -#elif defined(__FreeBSD__) || defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__DragonFly__) size_t size; long cp_time[CPUSTATES]; size = sizeof cp_time; -- cgit v1.2.3