Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sysconf on macOS to determine number of CPUs #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use sysconf on macOS to determine number of CPUs #87

wants to merge 1 commit into from

Conversation

moshegottlieb
Copy link

@moshegottlieb moshegottlieb commented Jan 8, 2017

Added #if defined(__APPLE__) wrapper for count_processors, using sysconf (in libc, include unistd.h which is already indirectly included).
sysconf(_SC_NPROCESSORS_ONLN) returns the number of processors currently online or -1 if there was an error, this function uses -1 to denote an error so this works fine.

Added #if defined(__APPLE__) wrapper for count_processors, using sysconf (libc, include unistd.h which is already indirectly included).
sysconf(_SC_NPROCESSORS_ONLN) returns the number of processors currently online or -1 if there was an error, this function uses -1 to denote an error so this works fine.
@kenorb
Copy link

kenorb commented Apr 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants