1 /* Conky, a system monitor, based on torsmo
3 * Any original torsmo code is licensed under the BSD license
5 * All code written since the fork of torsmo is licensed under the GPL
7 * Please see COPYING for details
9 * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
11 * All rights reserved.
13 * This program is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #include <sys/ioctl.h>
28 #include <sys/dkstat.h>
29 #include <sys/param.h>
30 #include <sys/resource.h>
31 #include <sys/socket.h>
33 #include <sys/sysctl.h>
35 #include <sys/types.h>
39 #include <net/if_mib.h>
40 #include <net/if_media.h>
41 #include <net/if_var.h>
48 #include <dev/wi/if_wavelan_ieee.h>
49 #include <dev/acpica/acpiio.h>
57 #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var))
58 #define KELVTOC(x) ((x - 2732) / 10.0)
59 #define MAXSHOWDEVS 16
65 __attribute__((gnu_inline)) inline void
66 proc_find_top(struct process **cpu, struct process **mem);
68 static short cpu_setup = 0;
70 static int getsysctl(const char *name, void *ptr, size_t len)
74 if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) {
78 if (nlen != len && errno == ENOMEM) {
85 struct ifmibdata *data = NULL;
88 static int swapmode(unsigned long *retavail, unsigned long *retfree)
91 unsigned long pagesize = getpagesize();
92 struct kvm_swap swapary[1];
97 #define CONVERT(v) ((quad_t)(v) * (pagesize / 1024))
99 n = kvm_getswapinfo(kd, swapary, 1, 0);
100 if (n < 0 || swapary[0].ksw_total == 0) {
104 *retavail = CONVERT(swapary[0].ksw_total);
105 *retfree = CONVERT(swapary[0].ksw_total - swapary[0].ksw_used);
107 n = (int) ((double) swapary[0].ksw_used * 100.0 /
108 (double) swapary[0].ksw_total);
113 void prepare_update(void)
117 void update_uptime(void)
119 int mib[2] = { CTL_KERN, KERN_BOOTTIME };
120 struct timeval boottime;
122 size_t size = sizeof(boottime);
124 if ((sysctl(mib, 2, &boottime, &size, NULL, 0) != -1)
125 && (boottime.tv_sec != 0)) {
127 info.uptime = now - boottime.tv_sec;
129 fprintf(stderr, "Could not get uptime\n");
134 int check_mount(char *s)
136 struct statfs *mntbuf;
139 mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
140 for (i = mntsize - 1; i >= 0; i--) {
141 if (strcmp(mntbuf[i].f_mntonname, s) == 0) {
149 void update_meminfo(void)
151 u_int total_pages, inactive_pages, free_pages;
152 unsigned long swap_avail, swap_free;
154 int pagesize = getpagesize();
156 if (GETSYSCTL("vm.stats.vm.v_page_count", total_pages)) {
157 fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_page_count\"\n");
160 if (GETSYSCTL("vm.stats.vm.v_free_count", free_pages)) {
161 fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_free_count\"\n");
164 if (GETSYSCTL("vm.stats.vm.v_inactive_count", inactive_pages)) {
165 fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_inactive_count\"\n");
168 info.memmax = total_pages * (pagesize >> 10);
169 info.mem = (total_pages - free_pages - inactive_pages) * (pagesize >> 10);
170 info.memeasyfree = info.memfree = info.memmax - info.mem;
172 if ((swapmode(&swap_avail, &swap_free)) >= 0) {
173 info.swapmax = swap_avail;
174 info.swap = (swap_avail - swap_free);
181 void update_net_stats(void)
185 long long r, t, last_recv, last_trans;
186 struct ifaddrs *ifap, *ifa;
190 delta = current_update_time - last_update_time;
191 if (delta <= 0.0001) {
195 if (getifaddrs(&ifap) < 0) {
199 for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
200 ns = get_net_stat((const char *) ifa->ifa_name);
202 if (ifa->ifa_flags & IFF_UP) {
203 struct ifaddrs *iftmp;
206 last_recv = ns->recv;
207 last_trans = ns->trans;
209 if (ifa->ifa_addr->sa_family != AF_LINK) {
213 for (iftmp = ifa->ifa_next;
214 iftmp != NULL && strcmp(ifa->ifa_name, iftmp->ifa_name) == 0;
215 iftmp = iftmp->ifa_next) {
216 if (iftmp->ifa_addr->sa_family == AF_INET) {
217 memcpy(&(ns->addr), iftmp->ifa_addr,
218 iftmp->ifa_addr->sa_len);
222 ifd = (struct if_data *) ifa->ifa_data;
226 if (r < ns->last_read_recv) {
227 ns->recv += ((long long) 4294967295U - ns->last_read_recv) + r;
229 ns->recv += (r - ns->last_read_recv);
232 ns->last_read_recv = r;
234 if (t < ns->last_read_trans) {
235 ns->trans += ((long long) 4294967295U -
236 ns->last_read_trans) + t;
238 ns->trans += (t - ns->last_read_trans);
241 ns->last_read_trans = t;
243 /* calculate speeds */
244 ns->recv_speed = (ns->recv - last_recv) / delta;
245 ns->trans_speed = (ns->trans - last_trans) / delta;
254 void update_total_processes(void)
258 kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
260 info.procs = n_processes;
263 void update_running_processes(void)
265 struct kinfo_proc *p;
269 p = kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
270 for (i = 0; i < n_processes; i++) {
271 #if (__FreeBSD__ < 5) && (__FreeBSD_kernel__ < 5)
272 if (p[i].kp_proc.p_stat == SRUN) {
274 if (p[i].ki_stat == SRUN) {
280 info.run_procs = cnt;
283 struct cpu_load_struct {
284 unsigned long load[5];
287 struct cpu_load_struct fresh = { {0, 0, 0, 0, 0} };
288 long cpu_used, oldtotal, oldused;
290 void get_cpu_count(void)
292 /* int cpu_count = 0; */
294 /* XXX: FreeBSD doesn't allow to get per CPU load stats on SMP machines.
295 * It's possible to get a CPU count, but as we fulfill only
296 * info.cpu_usage[0], it's better to report there's only one CPU.
297 * It should fix some bugs (e.g. cpugraph) */
299 if (GETSYSCTL("hw.ncpu", cpu_count) == 0) {
300 info.cpu_count = cpu_count;
305 info.cpu_usage = malloc(info.cpu_count * sizeof(float));
306 if (info.cpu_usage == NULL) {
311 /* XXX: SMP support */
312 void update_cpu_usage(void)
315 long cp_time[CPUSTATES];
316 size_t cp_len = sizeof(cp_time);
318 /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */
319 if ((cpu_setup == 0) || (!info.cpu_usage)) {
324 if (sysctlbyname("kern.cp_time", &cp_time, &cp_len, NULL, 0) < 0) {
325 fprintf(stderr, "Cannot get kern.cp_time");
328 fresh.load[0] = cp_time[CP_USER];
329 fresh.load[1] = cp_time[CP_NICE];
330 fresh.load[2] = cp_time[CP_SYS];
331 fresh.load[3] = cp_time[CP_IDLE];
332 fresh.load[4] = cp_time[CP_IDLE];
334 used = fresh.load[0] + fresh.load[1] + fresh.load[2];
335 total = fresh.load[0] + fresh.load[1] + fresh.load[2] + fresh.load[3];
337 if ((total - oldtotal) != 0) {
338 info.cpu_usage[0] = ((double) (used - oldused)) /
339 (double) (total - oldtotal);
341 info.cpu_usage[0] = 0;
348 void update_load_average(void)
354 info.loadavg[0] = (double) v[0];
355 info.loadavg[1] = (double) v[1];
356 info.loadavg[2] = (double) v[2];
359 double get_acpi_temperature(int fd)
364 if (GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp)) {
366 "Cannot read sysctl \"hw.acpi.thermal.tz0.temperature\"\n");
370 return KELVTOC(temp);
373 static void get_battery_stats(int *battime, int *batcapacity, int *batstate, int *ac) {
374 if (battime && GETSYSCTL("hw.acpi.battery.time", *battime)) {
375 fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.time\"\n");
377 if (batcapacity && GETSYSCTL("hw.acpi.battery.life", *batcapacity)) {
378 fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.life\"\n");
380 if (batstate && GETSYSCTL("hw.acpi.battery.state", *batstate)) {
381 fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.state\"\n");
383 if (ac && GETSYSCTL("hw.acpi.acline", *ac)) {
384 fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n");
388 void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item)
390 int battime, batcapacity, batstate, ac;
393 get_battery_stats(&battime, &batcapacity, &batstate, &ac);
395 if (batstate != 1 && batstate != 2 && batstate != 0 && batstate != 7)
396 fprintf(stderr, "Unknown battery state %d!\n", batstate);
397 else if (batstate != 1 && ac == 0)
398 fprintf(stderr, "Battery charging while not on AC!\n");
399 else if (batstate == 1 && ac == 1)
400 fprintf(stderr, "Battery discharing while on AC!\n");
404 if (batstate == 1 && battime != -1)
405 snprintf(buf, n, "%d:%2.2d", battime / 60, battime % 60);
408 if (batstate == 1) // Discharging
409 snprintf(buf, n, "remaining %d%%", batcapacity);
411 snprintf(buf, n, batstate == 2 ? "charging (%d%%)" :
412 (batstate == 7 ? "absent/on AC" : "charged (%d%%)"),
416 fprintf(stderr, "Unknown requested battery stat %d\n", item);
420 static int check_bat(const char *bat)
422 int batnum, numbatts;
424 if (GETSYSCTL("hw.acpi.battery.units", numbatts)) {
425 fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.units\"\n");
429 fprintf(stderr, "No battery unit detected\n");
432 if (!bat || (batnum = strtol(bat, &endptr, 10)) < 0 ||
433 bat == endptr || batnum > numbatts) {
434 fprintf(stderr, "Wrong battery unit %s requested\n", bat ? bat : "");
440 int get_battery_perct(const char *bat)
442 union acpi_battery_ioctl_arg battio;
444 int designcap, lastfulcap, batperct;
446 if ((battio.unit = batnum = check_bat(bat)) < 0)
448 if ((acpifd = open("/dev/acpi", O_RDONLY)) < 0) {
449 fprintf(stderr, "Can't open ACPI device\n");
452 if (ioctl(acpifd, ACPIIO_BATT_GET_BIF, &battio) == -1) {
453 fprintf(stderr, "Unable to get info for battery unit %d\n", batnum);
457 designcap = battio.bif.dcap;
458 lastfulcap = battio.bif.lfcap;
459 batperct = (designcap > 0 && lastfulcap > 0) ?
460 (int) (((float) lastfulcap / designcap) * 100) : 0;
461 return batperct > 100 ? 100 : batperct;
464 int get_battery_perct_bar(const char *bar)
466 int batperct = get_battery_perct(bar);
467 return (int)(batperct * 2.56 - 1);
470 int open_acpi_temperature(const char *name)
473 /* Not applicable for FreeBSD. */
477 void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size)
481 if (!p_client_buffer || client_buffer_size <= 0) {
485 if (GETSYSCTL("hw.acpi.acline", state)) {
486 fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n");
491 strncpy(p_client_buffer, "Running on AC Power", client_buffer_size);
493 strncpy(p_client_buffer, "Running on battery", client_buffer_size);
497 void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size)
499 /* not implemented */
500 if (p_client_buffer && client_buffer_size > 0) {
501 memset(p_client_buffer, 0, client_buffer_size);
505 void get_adt746x_cpu(char *p_client_buffer, size_t client_buffer_size)
507 /* not implemented */
508 if (p_client_buffer && client_buffer_size > 0) {
509 memset(p_client_buffer, 0, client_buffer_size);
513 void get_adt746x_fan(char *p_client_buffer, size_t client_buffer_size)
515 /* not implemented */
516 if (p_client_buffer && client_buffer_size > 0) {
517 memset(p_client_buffer, 0, client_buffer_size);
521 /* rdtsc() and get_freq_dynamic() copied from linux.c */
523 #if defined(__i386) || defined(__x86_64)
524 __attribute__((gnu_inline)) inline unsigned long long int rdtsc(void)
526 unsigned long long int x;
528 __asm__ volatile(".byte 0x0f, 0x31":"=A" (x));
533 /* return system frequency in MHz (use divisor=1) or GHz (use divisor=1000) */
534 void get_freq_dynamic(char *p_client_buffer, size_t client_buffer_size,
535 const char *p_format, int divisor)
537 #if defined(__i386) || defined(__x86_64)
539 struct timeval tvstart, tvstop;
540 unsigned long long cycles[2]; /* gotta be 64 bit */
541 unsigned int microseconds; /* total time taken */
543 memset(&tz, 0, sizeof(tz));
545 /* get this function in cached memory */
546 gettimeofday(&tvstart, &tz);
548 gettimeofday(&tvstart, &tz);
550 /* we don't trust that this is any specific length of time */
553 gettimeofday(&tvstop, &tz);
554 microseconds = ((tvstop.tv_sec - tvstart.tv_sec) * 1000000) +
555 (tvstop.tv_usec - tvstart.tv_usec);
557 snprintf(p_client_buffer, client_buffer_size, p_format,
558 (float) ((cycles[1] - cycles[0]) / microseconds) / divisor);
560 get_freq(p_client_buffer, client_buffer_size, p_format, divisor, 1);
565 char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format,
566 int divisor, unsigned int cpu)
571 freq_sysctl = (char *) calloc(16, sizeof(char));
572 if (freq_sysctl == NULL) {
576 snprintf(freq_sysctl, 16, "dev.cpu.%d.freq", (cpu - 1));
578 if (!p_client_buffer || client_buffer_size <= 0 || !p_format
583 if (GETSYSCTL(freq_sysctl, freq) == 0) {
584 snprintf(p_client_buffer, client_buffer_size, p_format,
585 (float) freq / divisor);
587 snprintf(p_client_buffer, client_buffer_size, p_format, 0.0f);
594 void update_top(void)
596 proc_find_top(info.cpu, info.memu);
600 void update_wifi_stats(void)
602 struct ifreq ifr; /* interface stats */
605 struct ifaddrs *ifap, *ifa;
606 struct ifmediareq ifmr;
609 /* Get iface table */
610 if (getifaddrs(&ifap) < 0) {
614 for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
615 ns = get_net_stat((const char *) ifa->ifa_name);
617 s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
620 bzero(&ifmr, sizeof(ifmr));
621 strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ);
622 if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) {
627 /* We can monitor only wireless interfaces
628 * which are not in hostap mode */
629 if ((ifmr.ifm_active & IFM_IEEE80211)
630 && !(ifmr.ifm_active & IFM_IEEE80211_HOSTAP)) {
632 bzero(&ifr, sizeof(ifr));
633 strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ);
634 wireq.wi_type = WI_RID_COMMS_QUALITY;
635 wireq.wi_len = WI_MAX_DATALEN;
636 ifr.ifr_data = (void *) &wireq;
638 if (ioctl(s, SIOCGWAVELAN, (caddr_t) &ifr) < 0) {
639 perror("ioctl (getting wi status)");
643 /* wi_val[0] = quality
645 * wi_val[2] = noise */
646 ns->linkstatus = (int) wireq.wi_val[1];
654 void update_diskio(void)
656 int devs_count, num_selected, num_selections, dn;
657 struct device_selection *dev_select = NULL;
658 long select_generation;
659 static struct statinfo statinfo_cur;
660 char device_name[text_buffer_size];
661 struct diskio_stat *cur;
662 unsigned int reads, writes;
663 unsigned int total_reads = 0, total_writes = 0;
666 memset(&statinfo_cur, 0, sizeof(statinfo_cur));
667 statinfo_cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo));
668 stats.current = stats.current_read = stats.current_write = 0;
670 if (devstat_getdevs(NULL, &statinfo_cur) < 0) {
671 free(statinfo_cur.dinfo);
675 devs_count = statinfo_cur.dinfo->numdevs;
676 if (devstat_selectdevs(&dev_select, &num_selected, &num_selections,
677 &select_generation, statinfo_cur.dinfo->generation,
678 statinfo_cur.dinfo->devices, devs_count, NULL, 0, NULL, 0,
679 DS_SELECT_ONLY, MAXSHOWDEVS, 1) >= 0) {
680 for (dn = 0; dn < devs_count; dn++) {
684 di = dev_select[dn].position;
685 dev = &statinfo_cur.dinfo->devices[di];
686 snprintf(device_name, text_buffer_size, "%s%d",
687 dev_select[dn].device_name, dev_select[dn].unit_number);
689 total_reads += (reads = dev->bytes[DEVSTAT_READ] / 512);
690 total_writes += (writes = dev->bytes[DEVSTAT_WRITE] / 512);
691 for (cur = stats.next; cur; cur = cur->next) {
692 if (cur->dev && !strcmp(device_name, cur->dev)) {
693 update_diskio_values(cur, reads, writes);
698 update_diskio_values(&stats, total_reads, total_writes);
703 free(statinfo_cur.dinfo);
706 /* While topless is obviously better, top is also not bad. */
708 int comparecpu(const void *a, const void *b)
710 if (((const struct process *)a)->amount > ((const struct process *)b)->amount) {
712 } else if (((const struct process *)a)->amount < ((const struct process *)b)->amount) {
719 int comparemem(const void *a, const void *b)
721 if (((const struct process *)a)->totalmem > ((const struct process *)b)->totalmem) {
723 } else if (((const struct process *)a)->totalmem < ((const struct process *)b)->totalmem) {
730 __attribute__((gnu_inline)) inline void
731 proc_find_top(struct process **cpu, struct process **mem)
733 struct kinfo_proc *p;
736 struct process *processes;
740 /* we get total pages count again to be sure it is up to date */
741 if (GETSYSCTL("vm.stats.vm.v_page_count", total_pages) != 0) {
742 CRIT_ERR("Cannot read sysctl \"vm.stats.vm.v_page_count\"");
745 p = kvm_getprocs(kd, KERN_PROC_PROC, 0, &n_processes);
746 processes = malloc(n_processes * sizeof(struct process));
748 for (i = 0; i < n_processes; i++) {
749 if (!((p[i].ki_flag & P_SYSTEM)) && p[i].ki_comm != NULL) {
750 processes[j].pid = p[i].ki_pid;
751 processes[j].name = strndup(p[i].ki_comm, text_buffer_size);
752 processes[j].amount = 100.0 * p[i].ki_pctcpu / FSCALE;
753 processes[j].totalmem = (float) (p[i].ki_rssize /
754 (float) total_pages) * 100.0;
755 processes[j].vsize = p[i].ki_size;
756 processes[j].rss = (p[i].ki_rssize * getpagesize());
761 qsort(processes, j - 1, sizeof(struct process), comparemem);
762 for (i = 0; i < 10 && i < n_processes; i++) {
763 struct process *tmp, *ttmp;
765 tmp = malloc(sizeof(struct process));
766 tmp->pid = processes[i].pid;
767 tmp->amount = processes[i].amount;
768 tmp->totalmem = processes[i].totalmem;
769 tmp->name = strndup(processes[i].name, text_buffer_size);
770 tmp->rss = processes[i].rss;
771 tmp->vsize = processes[i].vsize;
781 qsort(processes, j - 1, sizeof(struct process), comparecpu);
782 for (i = 0; i < 10 && i < n_processes; i++) {
783 struct process *tmp, *ttmp;
785 tmp = malloc(sizeof(struct process));
786 tmp->pid = processes[i].pid;
787 tmp->amount = processes[i].amount;
788 tmp->totalmem = processes[i].totalmem;
789 tmp->name = strndup(processes[i].name, text_buffer_size);
790 tmp->rss = processes[i].rss;
791 tmp->vsize = processes[i].vsize;
801 #if defined(FREEBSD_DEBUG)
802 printf("=====\nmem\n");
803 for (i = 0; i < 10; i++) {
804 printf("%d: %s(%d) %.2f %ld %ld\n", i, mem[i]->name,
805 mem[i]->pid, mem[i]->totalmem, mem[i]->vsize, mem[i]->rss);
809 for (i = 0; i < j; i++) {
810 free(processes[i].name);
815 #if defined(i386) || defined(__i386__)
816 #define APMDEV "/dev/apm"
817 #define APM_UNKNOWN 255
819 int apm_getinfo(int fd, apm_info_t aip)
821 if (ioctl(fd, APMIO_GETINFO, aip) == -1) {
828 char *get_apm_adapter(void)
831 struct apm_info a_info;
834 out = (char *) calloc(16, sizeof(char));
836 fd = open(APMDEV, O_RDONLY);
838 strncpy(out, "ERR", 16);
842 if (apm_getinfo(fd, &a_info) != 0) {
844 strncpy(out, "ERR", 16);
849 switch (a_info.ai_acline) {
851 strncpy(out, "off-line", 16);
855 if (a_info.ai_batt_stat == 3) {
856 strncpy(out, "charging", 16);
859 strncpy(out, "on-line", 16);
864 strncpy(out, "unknown", 16);
870 char *get_apm_battery_life(void)
874 struct apm_info a_info;
877 out = (char *) calloc(16, sizeof(char));
879 fd = open(APMDEV, O_RDONLY);
881 strncpy(out, "ERR", 16);
885 if (apm_getinfo(fd, &a_info) != 0) {
887 strncpy(out, "ERR", 16);
892 batt_life = a_info.ai_batt_life;
893 if (batt_life == APM_UNKNOWN) {
894 strncpy(out, "unknown", 16);
895 } else if (batt_life <= 100) {
896 snprintf(out, 16, "%d%%", batt_life);
899 strncpy(out, "ERR", 16);
905 char *get_apm_battery_time(void)
910 struct apm_info a_info;
913 out = (char *) calloc(16, sizeof(char));
915 fd = open(APMDEV, O_RDONLY);
917 strncpy(out, "ERR", 16);
921 if (apm_getinfo(fd, &a_info) != 0) {
923 strncpy(out, "ERR", 16);
928 batt_time = a_info.ai_batt_time;
930 if (batt_time == -1) {
931 strncpy(out, "unknown", 16);
938 snprintf(out, 16, "%2d:%02d:%02d", h, m, s);
946 void get_battery_short_status(char *buffer, unsigned int n, const char *bat)
948 get_battery_stuff(buffer, n, bat, BATTERY_STATUS);
949 if (0 == strncmp("charging", buffer, 8)) {
951 memmove(buffer + 1, buffer + 8, n - 8);
952 } else if (0 == strncmp("discharging", buffer, 11)) {
954 memmove(buffer + 1, buffer + 11, n - 11);
955 } else if (0 == strncmp("absent/on AC", buffer, 12)) {
957 memmove(buffer + 1, buffer + 12, n - 12);
961 void update_entropy(void)
963 /* Not applicable for FreeBSD as it uses the yarrow prng. */
966 /* empty stub so conky links */
967 void free_all_processes(void)