Skip to content

Commit

Permalink
sysinfo.cc: Call getloadavg for Android API >= 29 (#1) (#1649)
Browse files Browse the repository at this point in the history
Support for `getloadavg` was added in API level 29.
  • Loading branch information
jmr committed Aug 14, 2023
1 parent 1c64a36 commit aa59d40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ std::vector<double> GetLoadAvg() {
#if (defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
defined BENCHMARK_OS_OPENBSD || defined BENCHMARK_OS_DRAGONFLY) && \
!defined(__ANDROID__)
!(defined(__ANDROID__) && __ANDROID_API__ < 29)
static constexpr int kMaxSamples = 3;
std::vector<double> res(kMaxSamples, 0.0);
const int nelem = getloadavg(res.data(), kMaxSamples);
Expand Down

0 comments on commit aa59d40

Please sign in to comment.