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

Unified Diff: sdk/lib/io/process.dart

Issue 895623002: Add support for killing a process with a given PID to dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
Index: sdk/lib/io/process.dart
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index a977b319b6173dd8bfe70d0cf62bfb952217c7ad..504f222bedb5bc0a482e12a30a76b94ba2c2624a 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -346,6 +346,20 @@ abstract class Process {
Encoding stderrEncoding: SYSTEM_ENCODING});
/**
+ * On Linux and Mac OS, [killPid] sends [signal] to the process with
Lasse Reichstein Nielsen 2015/02/03 14:00:47 Is it officially called Mac OS? Or is it just OS X
Søren Gjesse 2015/02/04 08:16:02 You are right. We are currently using Mac OS in th
+ * process id [pid].
+ *
+ * On Windows, `killPid` kills the process with process `pid` , ignoring the
+ * `signal` flag.
Lasse Reichstein Nielsen 2015/02/03 14:00:47 Start with a single statement describing the opera
Søren Gjesse 2015/02/04 08:16:02 Thanks, rewritten. The signals you can receive on
+ *
+ * Returns `true` if the signal is successfully sent and process is killed.
Lasse Reichstein Nielsen 2015/02/03 14:00:47 and process -> and the process What if the proces
Søren Gjesse 2015/02/04 08:16:02 You are right. We can only see if the signal was s
+ * 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;

Powered by Google App Engine
This is Rietveld 408576698