Commit f4c49ff9 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

"get max pid" for FreeBSD

parent da0956d1
......@@ -83,3 +83,13 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
*five = (double) loadAverage.ldavg[1] / 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);
int Platform_getMaxPid();
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment