The current implementation uses the wrong type for
given sysctl calls leading to overflow and incorrectly
reported RAM usage. The fix is to use 'unsigned int'
which is what FreeBSD expects.
const char *
ram_total(void) {
- long npages;
+ unsigned int npages;
size_t len;
len = sizeof(npages);
const char *
ram_perc(void) {
- long npages;
- long active;
+ unsigned int npages;
+ unsigned int active;
size_t len;
len = sizeof(npages);
const char *
ram_used(void) {
- long active;
+ unsigned int active;
size_t len;
len = sizeof(active);