diff --git a/freebsd/Platform.c b/freebsd/Platform.c index 694e2429..6239f33f 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -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; +} diff --git a/freebsd/Platform.h b/freebsd/Platform.h index 86601475..62bd7ca8 100644 --- a/freebsd/Platform.h +++ b/freebsd/Platform.h @@ -19,4 +19,6 @@ int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); +int Platform_getMaxPid(); + #endif