mirror of https://github.com/xzeldon/htop.git
"get max pid" for FreeBSD
This commit is contained in:
parent
da0956d1cd
commit
f4c49ff92e
|
@ -83,3 +83,13 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
|
||||||
*five = (double) loadAverage.ldavg[1] / loadAverage.fscale;
|
*five = (double) loadAverage.ldavg[1] / loadAverage.fscale;
|
||||||
*fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale;
|
*fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Platform_getMaxPid() {
|
||||||
|
int maxPid;
|
||||||
|
size_t size = sizeof(maxPid);
|
||||||
|
int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0);
|
||||||
|
if (err) {
|
||||||
|
return 99999;
|
||||||
|
}
|
||||||
|
return maxPid;
|
||||||
|
}
|
||||||
|
|
|
@ -19,4 +19,6 @@ int Platform_getUptime();
|
||||||
|
|
||||||
void Platform_getLoadAverage(double* one, double* five, double* fifteen);
|
void Platform_getLoadAverage(double* one, double* five, double* fifteen);
|
||||||
|
|
||||||
|
int Platform_getMaxPid();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue