Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: runtime/bin/platform_fuchsia.cc

Issue 2244253004: [fuchsia] Use sysconf to get number of processors (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/run_vm_tests_fuchsia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_OS_FUCHSIA)
7 7
8 #include "bin/platform.h" 8 #include "bin/platform.h"
9 9
10 #include <runtime/sysinfo.h>
11 #include <string.h> // NOLINT 10 #include <string.h> // NOLINT
12 #include <unistd.h> // NOLINT 11 #include <unistd.h> // NOLINT
13 12
14 #include "bin/fdutils.h" 13 #include "bin/fdutils.h"
15 #include "bin/file.h" 14 #include "bin/file.h"
16 15
17 namespace dart { 16 namespace dart {
18 namespace bin { 17 namespace bin {
19 18
20 const char* Platform::executable_name_ = NULL; 19 const char* Platform::executable_name_ = NULL;
21 char* Platform::resolved_executable_name_ = NULL; 20 char* Platform::resolved_executable_name_ = NULL;
22 int Platform::script_index_ = 1; 21 int Platform::script_index_ = 1;
23 char** Platform::argv_ = NULL; 22 char** Platform::argv_ = NULL;
24 23
25 bool Platform::Initialize() { 24 bool Platform::Initialize() {
26 return true; 25 return true;
27 } 26 }
28 27
29 28
30 int Platform::NumberOfProcessors() { 29 int Platform::NumberOfProcessors() {
31 return mxr_get_nprocs_conf(); 30 return sysconf(_SC_NPROCESSORS_CONF);
32 } 31 }
33 32
34 33
35 const char* Platform::OperatingSystem() { 34 const char* Platform::OperatingSystem() {
36 return "fuchsia"; 35 return "fuchsia";
37 } 36 }
38 37
39 38
40 const char* Platform::LibraryPrefix() { 39 const char* Platform::LibraryPrefix() {
41 return "lib"; 40 return "lib";
(...skipping 24 matching lines...) Expand all
66 65
67 66
68 void Platform::Exit(int exit_code) { 67 void Platform::Exit(int exit_code) {
69 exit(exit_code); 68 exit(exit_code);
70 } 69 }
71 70
72 } // namespace bin 71 } // namespace bin
73 } // namespace dart 72 } // namespace dart
74 73
75 #endif // defined(TARGET_OS_FUCHSIA) 74 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/run_vm_tests_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698