FreeBSD: misc

This commit is contained in:
Christian Göttsche
2021-01-27 15:11:50 +01:00
committed by BenBE
parent fdaa15bd8d
commit fa499fc155
3 changed files with 9 additions and 9 deletions

View File

@ -138,7 +138,7 @@ void Platform_setBindings(Htop_Action* keys) {
int Platform_getUptime() {
struct timeval bootTime, currTime;
int mib[2] = { CTL_KERN, KERN_BOOTTIME };
const int mib[2] = { CTL_KERN, KERN_BOOTTIME };
size_t size = sizeof(bootTime);
int err = sysctl(mib, 2, &bootTime, &size, NULL, 0);
@ -152,7 +152,7 @@ int Platform_getUptime() {
void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
struct loadavg loadAverage;
int mib[2] = { CTL_VM, VM_LOADAVG };
const int mib[2] = { CTL_VM, VM_LOADAVG };
size_t size = sizeof(loadAverage);
int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0);
@ -214,7 +214,6 @@ double Platform_setCPUValues(Meter* this, int cpu) {
}
void Platform_setMemoryValues(Meter* this) {
// TODO
const ProcessList* pl = this->pl;
this->total = pl->totalMem;
@ -243,7 +242,7 @@ void Platform_setZfsCompressedArcValues(Meter* this) {
}
char* Platform_getProcessEnv(pid_t pid) {
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ENV, pid };
const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ENV, pid };
size_t capacity = ARG_MAX;
char* env = xMalloc(capacity);