OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/sys_info.h" | 5 #include <stddef.h> |
6 | |
7 #include <errno.h> | |
8 #include <string.h> | |
9 #include <sys/param.h> | |
10 #include <sys/statvfs.h> | 6 #include <sys/statvfs.h> |
11 #include <sys/sysctl.h> | |
12 #include <sys/utsname.h> | 7 #include <sys/utsname.h> |
13 #include <unistd.h> | 8 #include <unistd.h> |
| 9 #include <string> |
| 10 |
| 11 #include "base/file_path.h" |
| 12 #include "base/sys_info.h" |
| 13 #include "build/build_config.h" |
14 | 14 |
15 #if !defined(OS_MACOSX) | 15 #if !defined(OS_MACOSX) |
16 #include <gdk/gdk.h> | 16 #include <gdk/gdk.h> |
17 #endif | 17 #endif |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/file_util.h" | |
21 #include "base/logging.h" | 20 #include "base/logging.h" |
22 #include "base/utf_string_conversions.h" | |
23 | 21 |
24 namespace base { | 22 namespace base { |
25 | 23 |
26 #if !defined(OS_OPENBSD) | 24 #if !defined(OS_OPENBSD) |
27 int SysInfo::NumberOfProcessors() { | 25 int SysInfo::NumberOfProcessors() { |
28 // It seems that sysconf returns the number of "logical" processors on both | 26 // It seems that sysconf returns the number of "logical" processors on both |
29 // Mac and Linux. So we get the number of "online logical" processors. | 27 // Mac and Linux. So we get the number of "online logical" processors. |
30 long res = sysconf(_SC_NPROCESSORS_ONLN); | 28 long res = sysconf(_SC_NPROCESSORS_ONLN); |
31 if (res == -1) { | 29 if (res == -1) { |
32 NOTREACHED(); | 30 NOTREACHED(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return gdk_screen_get_n_monitors(screen); | 97 return gdk_screen_get_n_monitors(screen); |
100 } | 98 } |
101 #endif | 99 #endif |
102 | 100 |
103 // static | 101 // static |
104 size_t SysInfo::VMAllocationGranularity() { | 102 size_t SysInfo::VMAllocationGranularity() { |
105 return getpagesize(); | 103 return getpagesize(); |
106 } | 104 } |
107 | 105 |
108 } // namespace base | 106 } // namespace base |
OLD | NEW |