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

Retrieve the number of online CPUs on OpenBSD and NetBSD #1916

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

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Feb 4, 2025

No description provided.

@brad0 brad0 force-pushed the sysinfo_openbsd_ncpu branch from 42d2ab4 to 3d3122c Compare February 4, 2025 01:56
@@ -153,11 +153,11 @@ ValueUnion GetSysctlImp(std::string const& name) {
int mib[2];

mib[0] = CTL_HW;
if ((name == "hw.ncpu") || (name == "hw.cpuspeed")) {
if ((name == "hw.ncpuonline") || (name == "hw.cpuspeed")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not ncpufound?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sysctl name is hw.ncpuonline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://man.openbsd.org/sysctl.2 includes ncpufound which seems to be more predictable in some cases (from brief reading i did). i'm not an expert but i want to make sure that we're picking the right one.

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.

2 participants