As suggested to me by "Jasper Lievisse Adriaanse" in an email:
On 2015-02-16 09:02 Jasper Lievisse Adriaanse <jasper@openbsd.org> wrote:
> You can actually use 'long' instead of juggling between 64 and 32 bit return
> types. I've impemented something similiar for libgtop years ago and never had
> any issues when using 'long' for both 64 and 32 platforms. Here's the
> refernce: https://git.gnome.org/browse/libgtop/tree/sysdeps/openbsd/cpu.c#n62
This is a better idea than what I've implemented. Also this should resolve
eventual occurrence of "unable to get cpu stats" problem on 64bit platforms we
do not detect.
- Instead of displaying hardware ram quantity, display ram available to be
allocated by applications. FreeBSD uses some ram for kernel, segment mappings
and other stuff. Those memory pages are not available for allocation by
applications.
- Calculate correctly ram usage. Active + Wired (buffers). Nothing else.
For more info see:
- http://www.cyberciti.biz/files/scripts/freebsd-memory.pl.txt
- conky source code on github
- output of top and vmstat on FreeBSD
- http://www.zabbix.com/forum/showthread.php?t=21826
- https://support.zabbix.com/browse/ZBXNEXT-774
htop on FreeBSD uses linux procfs compatibility layer, and thus it's readings
are a little off.
- Removed OpenBSD stuff from freebsd port
- Renamed bsd folder to freebsd since now it contains only
freebsd-relevant files.
- Changed CMake instructions to account for bsd port changes
- modified main source file to account for openbsd port