diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-23 17:29:03 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-05-16 14:26:49 -0300 |
commit | 97a912f7a832a662960749948049e15f3aecb2a7 (patch) | |
tree | 1cbe5852bd6175c6554cc2a405517de9a8787a0e /libio/bug-rewind.c | |
parent | f787e138aa0bf677bf74fa2a08595c446292f3d7 (diff) | |
download | glibc-97a912f7a832a662960749948049e15f3aecb2a7.tar.gz glibc-97a912f7a832a662960749948049e15f3aecb2a7.tar.xz glibc-97a912f7a832a662960749948049e15f3aecb2a7.zip |
linux: Use /sys/devices/system/cpu on __get_nprocs_conf (BZ#28991)
Currently on Linux __get_nprocs_conf first tries to enumerate the cpus present in the system by iterating on /sys/devices/system/cpuX directories. This only enumerates the CPUs that are present in system (but possibly offline), not taking in account possible CPU that might added in the system through hotplugging. Linux provides the maximum number of configured cpus on the /sys/devices/system/cpu file. Although it might present a larger value of possible active CPUs on some system (where kernel either get the information from firmaware or is configured at boot time), the information is what kernel presents to userland. This also change the returned value of _SC_NPROCESSORS_CONF, which aligns as the maximum configure cpu in the system. Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'libio/bug-rewind.c')
0 files changed, 0 insertions, 0 deletions