about summary refs log tree commit diff
path: root/elf/tst-dl_find_object-mod2.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-23 17:29:03 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-05-16 14:26:49 -0300
commit97a912f7a832a662960749948049e15f3aecb2a7 (patch)
tree1cbe5852bd6175c6554cc2a405517de9a8787a0e /elf/tst-dl_find_object-mod2.c
parentf787e138aa0bf677bf74fa2a08595c446292f3d7 (diff)
downloadglibc-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 'elf/tst-dl_find_object-mod2.c')
0 files changed, 0 insertions, 0 deletions