| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/process_metrics.h" | 5 #include "base/process/process_metrics.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <sys/resource.h> | 10 #include <sys/resource.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ProcessMetrics::~ProcessMetrics() { } | 26 ProcessMetrics::~ProcessMetrics() { } |
| 27 | 27 |
| 28 #if defined(OS_LINUX) | 28 #if defined(OS_LINUX) |
| 29 static const rlim_t kSystemDefaultMaxFds = 8192; | 29 static const rlim_t kSystemDefaultMaxFds = 8192; |
| 30 #elif defined(OS_MACOSX) | 30 #elif defined(OS_MACOSX) |
| 31 static const rlim_t kSystemDefaultMaxFds = 256; | 31 static const rlim_t kSystemDefaultMaxFds = 256; |
| 32 #elif defined(OS_SOLARIS) | 32 #elif defined(OS_SOLARIS) |
| 33 static const rlim_t kSystemDefaultMaxFds = 8192; | 33 static const rlim_t kSystemDefaultMaxFds = 8192; |
| 34 #elif defined(OS_FREEBSD) | 34 #elif defined(OS_FREEBSD) |
| 35 static const rlim_t kSystemDefaultMaxFds = 8192; | 35 static const rlim_t kSystemDefaultMaxFds = 8192; |
| 36 #elif defined(OS_FUCHSIA) |
| 37 // TODO(scottmg): This probably wrong. |
| 38 static const rlim_t kSystemDefaultMaxFds = 8192; |
| 36 #elif defined(OS_NETBSD) | 39 #elif defined(OS_NETBSD) |
| 37 static const rlim_t kSystemDefaultMaxFds = 1024; | 40 static const rlim_t kSystemDefaultMaxFds = 1024; |
| 38 #elif defined(OS_OPENBSD) | 41 #elif defined(OS_OPENBSD) |
| 39 static const rlim_t kSystemDefaultMaxFds = 256; | 42 static const rlim_t kSystemDefaultMaxFds = 256; |
| 40 #elif defined(OS_ANDROID) | 43 #elif defined(OS_ANDROID) |
| 41 static const rlim_t kSystemDefaultMaxFds = 1024; | 44 static const rlim_t kSystemDefaultMaxFds = 1024; |
| 42 #endif | 45 #endif |
| 43 | 46 |
| 44 size_t GetMaxFds() { | 47 size_t GetMaxFds() { |
| 45 rlim_t max_fds; | 48 rlim_t max_fds; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 73 } else { | 76 } else { |
| 74 PLOG(INFO) << "Failed to get file descriptor limit"; | 77 PLOG(INFO) << "Failed to get file descriptor limit"; |
| 75 } | 78 } |
| 76 } | 79 } |
| 77 | 80 |
| 78 size_t GetPageSize() { | 81 size_t GetPageSize() { |
| 79 return getpagesize(); | 82 return getpagesize(); |
| 80 } | 83 } |
| 81 | 84 |
| 82 } // namespace base | 85 } // namespace base |
| OLD | NEW |