summaryrefslogtreecommitdiff
path: root/sysutils/mate-power-manager/files/patch-src_gpm-load.c
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2013-11-23 11:39:07 +0000
committerKoop Mast <kwm@FreeBSD.org>2013-11-23 11:39:07 +0000
commita236e2d0bfa53f22be02c6a4cc7b2cf730bc69e1 (patch)
tree000a9ce64a1e669ce72ebf4b639d75f2ef29c214 /sysutils/mate-power-manager/files/patch-src_gpm-load.c
parentAdd p5-Devel-FindPerl 0.012, find the path to your perl. (diff)
Say hello to Mate 1.6.
Mate is a lite desktop forked from gnome2. Most of the work is done by Jeremy Messenger (mezz@). The only thing I did was update a few ports to later 1.6 release and attempting to keep up with ports infra changes. Resulting bugs are all mine. Mate is a sort of replacement for Gnome 2. So people wanting to keep a Gnome 2 like desktop should switch. Gnome 2 will be replaced by Gnome 3 in the near future. This switch will be announce with a transition time so people have more time to switch if they haven't already. This release was made possible by everyone that send friendly pokes to keep mate on my mind. Approved by: portmgr (bapt)
Diffstat (limited to 'sysutils/mate-power-manager/files/patch-src_gpm-load.c')
-rw-r--r--sysutils/mate-power-manager/files/patch-src_gpm-load.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/sysutils/mate-power-manager/files/patch-src_gpm-load.c b/sysutils/mate-power-manager/files/patch-src_gpm-load.c
new file mode 100644
index 000000000000..bd915e986605
--- /dev/null
+++ b/sysutils/mate-power-manager/files/patch-src_gpm-load.c
@@ -0,0 +1,46 @@
+--- src/gpm-load.c.orig 2012-07-28 22:37:47.000000000 -0500
++++ src/gpm-load.c 2012-07-28 22:39:40.000000000 -0500
+@@ -33,6 +33,10 @@
+ #include <kstat.h>
+ #include <sys/sysinfo.h>
+ #endif
++#if defined(__FreeBSD__)
++#include <sys/resource.h>
++#include <sys/sysctl.h>
++#endif
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif /* HAVE_UNISTD_H */
+@@ -151,6 +155,32 @@
+ return FALSE;
+ }
+
++#elif defined(__FreeBSD__)
++
++/**
++ * gpm_load_get_cpu_values:
++ * @cpu_idle: The idle time reported by the CPU
++ * @cpu_total: The total time reported by the CPU
++ * Return value: Success of reading of the kern.cp_time sysctl.
++ **/
++static gboolean
++gpm_load_get_cpu_values (long unsigned *cpu_idle, long unsigned *cpu_total)
++{
++ long cpts[CPUSTATES];
++ size_t length;
++
++ length = sizeof (cpts);
++ if (sysctlbyname ("kern.cp_time", cpts, &length, NULL, 0)) {
++ return FALSE;
++ }
++
++ *cpu_idle = (unsigned long) cpts[CP_IDLE];
++ *cpu_total = (unsigned long) (cpts[CP_USER] + cpts[CP_NICE] + \
++ cpts[CP_SYS] + cpts[CP_IDLE] + cpts[CP_INTR]);
++
++ return TRUE;
++}
++
+ #else
+
+ /**