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() to determine active and existing CPUs on Linux #1342

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

Commits on Dec 3, 2023

  1. Use sysconf() to determine active and existing CPUs on Linux

    Instead of enumerating the number of active and existing CPUs on Linux
    by iterating over the pseudo-files below /sys/devices/system/cpu/, it
    is better to retrieve the number of active and existing CPUs using the
    sysconf() function using _SC_NPROCESSORS_ONLN and _SC_NPROCESSORS_CONF
    which will always report the correct numbers.
    
    Fixes htop-dev#757
    glaubitz committed Dec 3, 2023
    Configuration menu
    Copy the full SHA
    d593023 View commit details
    Browse the repository at this point in the history