ref: 894d1a23b9b2a0358c36803e324e39d2e5e868e4
parent: c4586a2bed3c2305fab9715f288327aa213e47ff
parent: 5c949262ae474eb2cf58e81e6783f4a96b3bcc56
author: sijchen <sijchen@cisco.com>
date: Thu Oct 12 07:33:24 EDT 2017
Merge pull request #2858 from jamesr/fuchsia_port Support WelsQueryLogicalProcessInfo for Fuchsia
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -46,9 +46,11 @@
#include <sched.h>
#elif !defined(_WIN32) && !defined(__CYGWIN__)
#include <sys/types.h>
-#include <sys/sysctl.h>
#include <sys/param.h>
#include <unistd.h>
+#ifndef __Fuchsia__
+#include <sys/sysctl.h>
+#endif
#ifdef __APPLE__
#define HW_NCPU_NAME "hw.logicalcpu"
#else
@@ -536,6 +538,10 @@
pInfo->ProcessorCount = 1;
return WELS_THREAD_ERROR_OK;
+#elif defined(__Fuchsia__)
+
+ pInfo->ProcessorCount = sysconf(_SC_NPROCESSORS_ONLN);
+ return WELS_THREAD_ERROR_OK;
#else
size_t len = sizeof (pInfo->ProcessorCount);