summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-port.cc
diff options
context:
space:
mode:
authorFabrice de Gans-Riberi <fdegans@chromium.org>2018-05-03 19:06:45 (GMT)
committerFabrice de Gans-Riberi <fdegans@chromium.org>2018-05-03 19:06:45 (GMT)
commit13af91faff5aaec0a622601713bc4f8b89a8e108 (patch)
tree801dcc3e17c738755473ee65b0d13a4803d62c74 /googletest/src/gtest-port.cc
parent96c3c422ad1e1bd06da37e88cdd8e200b812f8f3 (diff)
downloadgoogletest-13af91faff5aaec0a622601713bc4f8b89a8e108.zip
googletest-13af91faff5aaec0a622601713bc4f8b89a8e108.tar.gz
googletest-13af91faff5aaec0a622601713bc4f8b89a8e108.tar.bz2
Fix more stuff and get tests to pass
Diffstat (limited to 'googletest/src/gtest-port.cc')
-rw-r--r--googletest/src/gtest-port.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc
index d632089..ce59586 100644
--- a/googletest/src/gtest-port.cc
+++ b/googletest/src/gtest-port.cc
@@ -64,6 +64,7 @@
#endif // GTEST_OS_AIX
#if GTEST_OS_FUCHSIA
+# include <zircon/process.h>
# include <zircon/syscalls.h>
#endif
@@ -163,7 +164,20 @@ size_t GetThreadCount() {
#elif GTEST_OS_FUCHSIA
size_t GetThreadCount() {
- return static_cast<size_t>(zx_system_get_num_cpus());
+ int dummy_buffer;
+ size_t avail;
+ zx_status_t status = zx_object_get_info(
+ zx_process_self(),
+ ZX_INFO_PROCESS_THREADS,
+ &dummy_buffer,
+ 0,
+ nullptr,
+ &avail);
+ if(status == ZX_OK) {
+ return avail;
+ } else {
+ return 0;
+ }
}
#else