- if ((kvm_obj = kvm_open (NULL, /* execfile */
- NULL, /* corefile */
- NULL, /* swapfile */
- O_RDONLY, /* flags */
- NULL)) /* errstr */
- == NULL)
+ kvm_obj = kvm_openfiles (NULL, "/dev/null", NULL, O_RDONLY, errbuf);
+
+ if (kvm_obj == NULL)
"used", used, "free", free,
other_name, other_value, NULL);
if (values_percentage)
"used", used, "free", free,
other_name, other_value, NULL);
if (values_percentage)
"used", used, "free", free,
other_name, other_value, NULL);
} /* }}} void swap_submit_usage */
"used", used, "free", free,
other_name, other_value, NULL);
} /* }}} void swap_submit_usage */
- swap_submit_usage (path, used, total - used, NULL, NAN);
+ swap_submit_usage (path, used * 1024.0, (total - used) * 1024.0,
+ NULL, NAN);
- swap_submit_usage (NULL, swap_used, swap_free,
- isnan (swap_cached) ? NULL : "cached", swap_cached);
+ swap_submit_usage (NULL, swap_used * 1024.0, swap_free * 1024.0,
+ isnan (swap_cached) ? NULL : "cached",
+ isnan (swap_cached) ? NAN : swap_cached * 1024.0);