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

Side by Side Diff: base/sys_info_openbsd.cc

Issue 1538743002: Switch to standard integer types in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEPS roll too Created 4 years, 12 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 | « base/sys_info_mac.cc ('k') | base/sys_info_posix.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/sys_info.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
7 #include <sys/param.h> 9 #include <sys/param.h>
8 #include <sys/shm.h> 10 #include <sys/shm.h>
9 #include <sys/sysctl.h> 11 #include <sys/sysctl.h>
10 12
11 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/macros.h"
12 15
13 namespace { 16 namespace {
14 17
15 int64_t AmountOfMemory(int pages_name) { 18 int64_t AmountOfMemory(int pages_name) {
16 long pages = sysconf(pages_name); 19 long pages = sysconf(pages_name);
17 long page_size = sysconf(_SC_PAGESIZE); 20 long page_size = sysconf(_SC_PAGESIZE);
18 if (pages == -1 || page_size == -1) { 21 if (pages == -1 || page_size == -1) {
19 NOTREACHED(); 22 NOTREACHED();
20 return 0; 23 return 0;
21 } 24 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 char name[256]; 69 char name[256];
67 size_t len = arraysize(name); 70 size_t len = arraysize(name);
68 if (sysctl(mib, arraysize(mib), name, &len, NULL, 0) < 0) { 71 if (sysctl(mib, arraysize(mib), name, &len, NULL, 0) < 0) {
69 NOTREACHED(); 72 NOTREACHED();
70 return std::string(); 73 return std::string();
71 } 74 }
72 return name; 75 return name;
73 } 76 }
74 77
75 } // namespace base 78 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_mac.cc ('k') | base/sys_info_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698