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

Get number of CPUs with sysconf() on Linux #1901

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Conversation

hdeller
Copy link
Contributor

@hdeller hdeller commented Jan 9, 2025

Avoid parsing the /proc/cpuinfo just to get number of CPUs. Instead use the portable function provided by glibc.

Avoid parsing the /proc/cpuinfo just to get number of CPUs.
Instead use the portable function provided by glibc.
@hdeller
Copy link
Contributor Author

hdeller commented Jan 9, 2025

This is a follow-up patch to #1900
Let's see if it survives the workflow checks.

@dmah42
Copy link
Member

dmah42 commented Jan 9, 2025

is this a relatively new addition or did i just not know about it when i started this? :)

@hdeller
Copy link
Contributor Author

hdeller commented Jan 9, 2025

It's really old. Man-page mentions POSIX.1-2008 and POSIX.1-2001.
Most people don't know that it exists....

Btw, the previous pull request (#1900) was completely OK, but it's sadly not sufficient to fix sparc64 buiid yet...

@dmah42
Copy link
Member

dmah42 commented Jan 9, 2025

clang-format would like some love please. the other failures are at HEAD.

@hdeller
Copy link
Contributor Author

hdeller commented Jan 9, 2025

I dropped the leading space, as mentioned by clang test.
Is it possible to merge both changes into one when you merge?

@dmah42 dmah42 merged commit c24774d into google:main Jan 9, 2025
75 of 86 checks passed
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