Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/process/internal_linux.h" | 5 #include "base/process/internal_linux.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 | 21 |
| 22 // Not defined on AIX by default. | |
|
Nico
2017/04/25 18:50:40
You build _linux files on aix?
rayb
2017/04/25 22:40:17
Yeah. To be exact 8 of them. Mostly related to pro
| |
| 23 #if defined(OS_AIX) | |
| 24 #define NAME_MAX 255 | |
| 25 #endif | |
| 26 | |
| 22 namespace base { | 27 namespace base { |
| 23 namespace internal { | 28 namespace internal { |
| 24 | 29 |
| 25 const char kProcDir[] = "/proc"; | 30 const char kProcDir[] = "/proc"; |
| 26 | 31 |
| 27 const char kStatFile[] = "stat"; | 32 const char kStatFile[] = "stat"; |
| 28 | 33 |
| 29 FilePath GetProcPidDir(pid_t pid) { | 34 FilePath GetProcPidDir(pid_t pid) { |
| 30 return FilePath(kProcDir).Append(IntToString(pid)); | 35 return FilePath(kProcDir).Append(IntToString(pid)); |
| 31 } | 36 } |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 // which means the answer is 100. | 222 // which means the answer is 100. |
| 218 // It may be the case that this value is always 100. | 223 // It may be the case that this value is always 100. |
| 219 static const int kHertz = sysconf(_SC_CLK_TCK); | 224 static const int kHertz = sysconf(_SC_CLK_TCK); |
| 220 | 225 |
| 221 return TimeDelta::FromMicroseconds( | 226 return TimeDelta::FromMicroseconds( |
| 222 Time::kMicrosecondsPerSecond * clock_ticks / kHertz); | 227 Time::kMicrosecondsPerSecond * clock_ticks / kHertz); |
| 223 } | 228 } |
| 224 | 229 |
| 225 } // namespace internal | 230 } // namespace internal |
| 226 } // namespace base | 231 } // namespace base |
| OLD | NEW |