OSDN Git Service

Fix the way to count online cpus.
authorYabin Cui <yabinc@google.com>
Tue, 29 Sep 2015 23:11:45 +0000 (16:11 -0700)
committerYabin Cui <yabinc@google.com>
Wed, 30 Sep 2015 00:49:37 +0000 (17:49 -0700)
commitcb6f599c44b144db26c13507dbd89805b8fe03be
tree2cd3dfa6f2d8b35b7c7db91a1b5c1a21a3875901
parentf16f4f8a6bac035db5f25538ddb4fe810d0719db
Fix the way to count online cpus.

Read /proc/stat to count online cpus is not correct for all android
kernels. Change to reading /sys/devices/system/cpu/online instead.

Bug: 24376925
Change-Id: I3785a6c7aa15a467022a9a261b457194d688fb38
libc/bionic/sysinfo.cpp
libc/private/get_cpu_count_from_string.h [new file with mode: 0644]
tests/unistd_test.cpp