File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 6060#elif (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__)) && defined(__aarch64__)
6161#include < sys/sysctl.h>
6262#include < sys/types.h>
63+ #include < unistd.h>
6364#endif /* defined(__APPLE__) && defined(__aarch64__)) */
6465#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__) && (defined(__arm__) || defined(__aarch64__)) */
6566
@@ -438,7 +439,8 @@ CpuInfo CpuInfo::build()
438439
439440#elif defined(__aarch64__) && (defined(__OpenBSD__) || defined(__FreeBSD__))
440441 /* #elif(BARE_METAL) && defined(__aarch64__) */
441- int ncpus = get_hw_capability (" hw.ncpu" );
442+ int ncpus = sysconf (_SC_NPROCESSORS_ONLN);
443+
442444 CpuIsaInfo isainfo;
443445 std::vector<CpuModel> cpus_model (ncpus);
444446 isainfo.neon = get_hw_capability (" hw.optional.neon" );
You can’t perform that action at this time.
0 commit comments