diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2011-05-01 19:52:00 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2011-05-01 19:52:00 +0000 |
commit | e2d4219b8c51c57e4c9953fd4566020d1cbe27be (patch) | |
tree | 8ceca6123d051f54c9f8d71a3699c5653f22c8b9 /sysutils/wmzazof/files/patch-wmzazof.c | |
parent | Remove unmaintained expired ports from textproc (diff) |
Remove unmaintained expired ports from sysutils
2011-05-01 sysutils/acidlaunch: Upstream disapear and distfile is no more available
2011-05-01 sysutils/cpbk: Upstream disapear and distfile is no more available
2011-05-01 sysutils/dc42wrap: Upstream disapear and distfile is no more available
2011-05-01 sysutils/deleted: Upstream disapear and distfile is no more available
2011-05-01 sysutils/dolly+: Upstream disapear and distfile is no more available
2011-05-01 sysutils/durep: Upstream disapear and distfile is no more available
2011-05-01 sysutils/dvdtape: Upstream disapear and distfile is no more available
2011-05-01 sysutils/flock: Upstream disapear and distfile is no more available
2011-05-01 sysutils/fontedit: Upstream disapear and distfile is no more available
2011-05-01 sysutils/ftrace: Upstream disapear and distfile is no more available
2011-05-01 sysutils/gfslicer: Upstream disapear and distfile is no more available
2011-05-01 sysutils/ghasher: Upstream disapear and distfile is no more available
2011-05-01 sysutils/gkrellmouse: Upstream disapear and distfile is no more available
2011-05-01 sysutils/gkrellmwho: Upstream disapear and distfile is no more available
2011-05-01 sysutils/glload: Upstream disapear and distfile is no more available
2011-05-01 sysutils/gnomefind: Abandoned upstream
2011-05-01 sysutils/graft: Upstream disapear and distfile is no more available
2011-05-01 sysutils/growspd: Upstream disapear and distfile is no more available
2011-05-01 sysutils/gtoaster: Upstream disapear and distfile is no more available
2011-05-01 sysutils/idled: Upstream disapear and distfile is no more available, consider using sysutils/doinkd
2011-05-01 sysutils/maint: Upstream disapear and distfile is no more available
2011-05-01 sysutils/ndir: Upstream disapear and distfile is no more available
2011-05-01 sysutils/p5-LJ-Cache: Upstream disapear and distfile is no more available
2011-05-01 sysutils/p5-LJ-TextMessage: Upstream disapear and distfile is no more available
2011-05-01 sysutils/reclinker: Upstream disapear and distfile is no more available
2011-05-01 sysutils/rotate: Upstream disapear and distfile is no more available
2011-05-01 sysutils/ticker.app: Upstream disapear and distfile is no more available
2011-05-01 sysutils/upsmon: Upstream disapear and distfile is no more available
2011-05-01 sysutils/usbutil: Upstream disapear and distfile is no more available
2011-05-01 sysutils/uwatch: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmavgload: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmfsm: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmhm: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wminet: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmlmmon: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmlongrun: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmmemmon: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmmount: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmpccard: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmshutdown: Upstream disapear and distfile is no more available
2011-05-01 sysutils/wmzazof: Upstream disapear and distfile is no more available
Notes
Notes:
svn path=/head/; revision=273412
Diffstat (limited to 'sysutils/wmzazof/files/patch-wmzazof.c')
-rw-r--r-- | sysutils/wmzazof/files/patch-wmzazof.c | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/sysutils/wmzazof/files/patch-wmzazof.c b/sysutils/wmzazof/files/patch-wmzazof.c deleted file mode 100644 index 113e9a9cb266..000000000000 --- a/sysutils/wmzazof/files/patch-wmzazof.c +++ /dev/null @@ -1,104 +0,0 @@ ---- wmzazof.c Mon Dec 17 13:55:01 2001 -+++ wmzazof-patch.c Tue Dec 18 12:04:23 2001 -@@ -24,6 +24,11 @@ - #include <dockapp.h> - #include <unistd.h> - #include <string.h> -+#include <time.h> -+#include <sys/time.h> -+#include <sys/sysctl.h> -+#include <sys/vmmeter.h> -+#include <vm/vm_param.h> - #include "pix/master.xpm" - #include "pix/numbers.xpm" - #include "pix/char.xpm" -@@ -61,6 +66,9 @@ - - char *displayName = ""; - -+struct timeval boottime; -+int page_size; -+ - unsigned int *cmdline; - - FILE *file; -@@ -130,43 +138,22 @@ - - void check_values() - { -- char input[128]; -- char* token = " "; -- char* uptime_s; -- char* mem_used_s; -- char* mem_free_s; -- char* mem_cached_s; -- char* temp_s; -+ time_t now = time(NULL); -+ int mib[2] = { CTL_VM, VM_METER }, mcs = sizeof(mem_cached); -+ struct vmtotal meter; -+ size_t size = sizeof(meter); - -- /* /proc/uptime -- * -- * first value is the uptime in seconds -- */ -- file = fopen("/proc/uptime", "r"); -- fgets(input, 128, file); -- fclose(file); -- uptime_s = strtok(input, token); - // uptime in seconds -- uptime = atoi(uptime_s); -- -- /* /proc/meminfo -- * -- */ -- file = fopen("/proc/meminfo", "r"); -- fgets(input, 128, file); -- fgets(input, 128, file); -- fclose(file); -- temp_s = strtok(input, token); -- temp_s = strtok(NULL, token); // total -- mem_used_s = strtok(NULL, token); // used -- mem_free_s = strtok(NULL, token); // free -- temp_s = strtok(NULL, token); // shared -- temp_s = strtok(NULL, token); // buffers -- mem_cached_s = strtok(NULL, token); // cached -+ uptime = now - boottime.tv_sec; -+ - // in Kb -- mem_used = atoi(mem_used_s) / 1024; -- mem_free = atoi(mem_free_s) / 1024; -- mem_cached = atoi(mem_cached_s) / 1024; -+ if (sysctl(mib, 2, &meter, &size, NULL, 0) != -1 && -+ sysctlbyname("vm.stats.vm.v_cache_count", &mem_cached, &mcs, NULL, 0) != -1) -+ { -+ mem_used = meter.t_rm * page_size / 1024; -+ mem_free = meter.t_free * page_size / 1024; -+ mem_cached = mem_cached * page_size / 1024; -+ } - } - - void transform_values() -@@ -219,6 +206,9 @@ - int main (int argc, char **argv) - { - unsigned int height, width; -+ -+ int mib[2] = { CTL_KERN, KERN_BOOTTIME }; -+ size_t size_bt = sizeof(boottime), size_ps = sizeof(page_size); - - DACallbacks callbacks = { NULL, buttonPressCallback, NULL, NULL, NULL, NULL, NULL }; - -@@ -238,6 +228,12 @@ - state_mem_free = MEM_FREE_CACHED; - state_mem_used = MEM_USED_CACHED; - -+ if (sysctl(mib, 2, &boottime, &size_bt, NULL, 0) == -1 || -+ sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size_ps, NULL, 0) == -1) -+ { -+ perror(NULL); -+ exit(EXIT_FAILURE); -+ } - - while (1) - { |