Index: sdk/lib/io/process.dart |
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart |
index a977b319b6173dd8bfe70d0cf62bfb952217c7ad..4860267a61920181b4261bd5e70647b8c44ff8e5 100644 |
--- a/sdk/lib/io/process.dart |
+++ b/sdk/lib/io/process.dart |
@@ -346,6 +346,25 @@ abstract class Process { |
Encoding stderrEncoding: SYSTEM_ENCODING}); |
/** |
+ * Kills the process with id [pid]. |
+ * |
+ * Where possible, sends the [signal] to the process with id |
+ * `pid`. This includes Linux and OS X. The default signal is |
+ * [ProcessSignal.SIGTERM] which will normally terminate the |
+ * process. |
+ * |
+ * On platforms without signal support, including Windows, the call |
+ * just terminates the process with id `pid` in a platform specific |
+ * way, and the `signal` parameter is ignored. |
+ * |
+ * Returns `true` if the signal is successfully delivered to the |
+ * process. Otherwise the signal could not be sent, usually meaning |
+ * that the process is already dead. |
+ */ |
+ external static bool killPid( |
+ int pid, [ProcessSignal signal = ProcessSignal.SIGTERM]); |
+ |
+ /** |
* Returns the standard output stream of the process as a [:Stream:]. |
*/ |
Stream<List<int>> get stdout; |
@@ -366,15 +385,19 @@ abstract class Process { |
int get pid; |
/** |
- * On Linux and Mac OS, [kill] sends [signal] to the process. When the process |
- * terminates as a result of calling [kill], the value for [exitCode] may be a |
- * negative number corresponding to the provided [signal]. |
+ * Kills the process. |
+ * |
+ * Where possible, sends the [signal] to the process. This includes |
+ * Linux and OS X. The default signal is [ProcessSignal.SIGTERM] |
+ * which will normally terminate the process. |
* |
- * On Windows, [kill] kills the process, ignoring the [signal] flag. |
+ * On platforms without signal support, including Windows, the call |
+ * just terminates the process in a platform specific way, and the |
+ * `signal` parameter is ignored. |
* |
- * Returns [:true:] if the signal is successfully sent and process is killed. |
- * Otherwise the signal could not be sent, usually meaning that the process is |
- * already dead. |
+ * Returns `true` if the signal is successfully delivered to the |
+ * process. Otherwise the signal could not be sent, usually meaning |
+ * that the process is already dead. |
*/ |
bool kill([ProcessSignal signal = ProcessSignal.SIGTERM]); |
} |