X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fnetbsd.c;h=d1236bb8364cf54fcfca147c2fea19ac6d2f967d;hb=04435790955e0671f512f7b180e7d8fadeb4ceff;hp=82bcacfada71c73fe763407c5ec95317ce449540;hpb=be2cd44e6d271b8e0e5ec88ad5581fccf29ca94c;p=monky
diff --git a/src/netbsd.c b/src/netbsd.c
index 82bcacf..d1236bb 100644
--- a/src/netbsd.c
+++ b/src/netbsd.c
@@ -1,4 +1,7 @@
-/* Conky, a system monitor, based on torsmo
+/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
+ * vim: ts=4 sw=4 noet ai cindent syntax=c
+ *
+ * Conky, a system monitor, based on torsmo
*
* Any original torsmo code is licensed under the BSD license
*
@@ -7,7 +10,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
- * Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@@ -23,38 +26,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
- * $Id$ */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include
+ */
-#include
-
-#include "conky.h"
+#include "netbsd.h"
+#include "net_stat.h"
static kvm_t *kd = NULL;
int kd_init = 0, nkd_init = 0;
@@ -148,9 +123,6 @@ void update_meminfo()
struct uvmexp_sysctl uvmexp;
size_t size = sizeof(uvmexp);
- info.memmax = info.mem = 0;
- info.swapmax = info.swap = 0;
-
if (sysctl(mib, 2, &uvmexp, &size, NULL, 0) < 0) {
warn("could not get memory info");
return;
@@ -162,10 +134,12 @@ void update_meminfo()
info.memmax = (total_pages * pagesize) >> 10;
info.mem = ((total_pages - free_pages - inactive_pages) * pagesize) >> 10;
+ info.memeasyfree = info.memfree = info.memmax - info.mem;
if (swapmode(&swap_avail, &swap_free) >= 0) {
info.swapmax = swap_avail;
info.swap = (swap_avail - swap_free);
+ info.swapfree = swap_free;
}
}
@@ -216,7 +190,7 @@ void update_net_stats()
long long last_recv, last_trans;
kvm_read(nkd, (u_long) ifnetaddr, (void *) &ifnet, sizeof(ifnet));
- ns = get_net_stat(ifnet.if_xname);
+ ns = get_net_stat(ifnet.if_xname, NULL, NULL);
ns->up = 1;
last_recv = ns->recv;
last_trans = ns->trans;
@@ -333,11 +307,6 @@ void update_cpu_usage()
oldtotal = total;
}
-double get_sysfs_info(int *fd, int div, char *devtype)
-{
- return -1;
-}
-
void update_load_average()
{
double v[3];
@@ -358,19 +327,15 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item)
{
}
-int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
- int *div, char *devtype)
-{
- return -1;
-}
-
int open_acpi_temperature(const char *name)
{
return -1;
}
-void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size)
+void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter)
{
+ (void) adapter; // only linux uses this
+
if (!p_client_buffer || client_buffer_size <= 0) {
return;
}
@@ -390,6 +355,12 @@ void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size)
memset(p_client_buffer, 0, client_buffer_size);
}
-void update_entropy(void)
+int get_entropy_avail(unsigned int *val)
{
+ return 1;
+}
+
+int get_entropy_poolsize(unsigned int *val)
+{
+ return 1;
}