]> khamidou — GitHub mirrors - electron.git/commitdiff
process: api to set file descriptor soft limit
authorRobo <hop2deep@gmail.com>
Sat, 29 Aug 2015 15:14:52 +0000 (20:44 +0530)
committerRobo <hop2deep@gmail.com>
Mon, 31 Aug 2015 07:30:04 +0000 (13:00 +0530)
atom/common/api/atom_bindings.cc
docs/api/app.md
docs/api/process.md

index c748647f48d05beb8681195e14b31cfd3bd5e515..d6fb355e09d8d1cb075656acc0d663a9338ce820 100644 (file)
@@ -11,6 +11,7 @@
 #include "atom/common/chrome_version.h"
 #include "atom/common/native_mate_converters/string16_converter.h"
 #include "base/logging.h"
+#include "base/process/process_metrics.h"
 #include "native_mate/dictionary.h"
 
 #include "atom/common/node_includes.h"
@@ -61,6 +62,9 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
   dict.SetMethod("crash", &Crash);
   dict.SetMethod("hang", &Hang);
   dict.SetMethod("log", &Log);
+#if defined(OS_POSIX)
+  dict.SetMethod("setFdLimit", &base::SetFdLimit);
+#endif
   dict.SetMethod("activateUvLoop",
       base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this)));
 
index db34d37ec59e60d0a12f02e8c3030d0ba6148522..07b26f2c566300815b9fa2c6d9d8a226b76760b5 100644 (file)
@@ -269,7 +269,6 @@ Adds `tasks` to the [Tasks][tasks] category of the JumpList on Windows.
   consists of two or more icons, set this value to identify the icon. If an
   icon file consists of one icon, this value is 0.
 
-
 ### `app.commandLine.appendSwitch(switch[, value])`
 
 Append a switch (with optional `value`) to Chromium's command line.
index c9efa22fe0f9634ead43b485f167cf148fbe6633..930a5860fc44411f63d66c18d31b4e78d50bcdaf 100644 (file)
@@ -11,3 +11,10 @@ upstream node:
 ## process.hang
 
 Causes the main thread of the current process hang.
+
+## process.setFdLimit(maxDescriptors) _OS X_ _Linux_
+
+* `maxDescriptors` Integer
+
+Sets the file descriptor soft limit to `maxDescriptors` or the OS hard
+limit, whichever is lower for the current process.