diff options
Diffstat (limited to 'src/mongo/util/processinfo_freebsd.cpp')
-rw-r--r-- | src/mongo/util/processinfo_freebsd.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/util/processinfo_freebsd.cpp b/src/mongo/util/processinfo_freebsd.cpp index 461405aad90..d9bf1aa72fd 100644 --- a/src/mongo/util/processinfo_freebsd.cpp +++ b/src/mongo/util/processinfo_freebsd.cpp @@ -189,4 +189,12 @@ bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, vector<char> } return true; } + +// get the number of CPUs available to the scheduler +boost::optional<unsigned long> ProcessInfo::getNumAvailableCores() { + long nprocs = sysconf(_SC_NPROCESSORS_ONLN); + if (nprocs) + return nprocs; + return boost::none; } +} // namespace mongo |