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

Unified Diff: base/process/process_metrics_ios.cc

Issue 19064002: Split ProcessHandle and its related routines into base/process/process_handle.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_metrics.h ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_ios.cc
diff --git a/base/process/process_metrics_ios.cc b/base/process/process_metrics_ios.cc
index 9f0e8c6ba98603db8a4da4dda3d6ea9c2af59bbd..94c671901b6ee97affcca3c21695abff4d935e2a 100644
--- a/base/process/process_metrics_ios.cc
+++ b/base/process/process_metrics_ios.cc
@@ -44,4 +44,21 @@ size_t ProcessMetrics::GetWorkingSetSize() const {
return task_info_data.resident_size;
}
+size_t GetMaxFds() {
+ static const rlim_t kSystemDefaultMaxFds = 256;
+ rlim_t max_fds;
+ struct rlimit nofile;
+ if (getrlimit(RLIMIT_NOFILE, &nofile)) {
+ // Error case: Take a best guess.
+ max_fds = kSystemDefaultMaxFds;
+ } else {
+ max_fds = nofile.rlim_cur;
+ }
+
+ if (max_fds > INT_MAX)
+ max_fds = INT_MAX;
+
+ return static_cast<size_t>(max_fds);
+}
+
} // namespace base
« no previous file with comments | « base/process/process_metrics.h ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698