[PATCH] D126071: [benchmark] getloadavg not supported under uclibc-ng.

Lance Fredrickson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 07:54:26 PDT 2022


lancethepants created this revision.
Herald added subscribers: lebedev.ri, krytarowski.
Herald added a reviewer: lebedev.ri.
Herald added a project: All.
lancethepants requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The uclibc-ng standard library does not support getloadavg so we stub it out along with android.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126071

Files:
  third-party/benchmark/src/sysinfo.cc


Index: third-party/benchmark/src/sysinfo.cc
===================================================================
--- third-party/benchmark/src/sysinfo.cc
+++ third-party/benchmark/src/sysinfo.cc
@@ -687,7 +687,7 @@
 #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__) && !defined(__UCLIBC__)
   constexpr int kMaxSamples = 3;
   std::vector<double> res(kMaxSamples, 0.0);
   const int nelem = getloadavg(res.data(), kMaxSamples);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126071.430973.patch
Type: text/x-patch
Size: 655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220520/54feada7/attachment.bin>


More information about the llvm-commits mailing list