mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
FreeBSD: misc
This commit is contained in:

committed by
BenBE

parent
fdaa15bd8d
commit
fa499fc155
@ -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);
|
||||
|
Reference in New Issue
Block a user