Chromium Code Reviews| Index: sdk/lib/io/process.dart |
| diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart |
| index fc2a4aa7d455d0f9ebfe170230edc244eb8fc5d4..fd61c56e5145ab8c4a279962bd10b59df84e8fd5 100644 |
| --- a/sdk/lib/io/process.dart |
| +++ b/sdk/lib/io/process.dart |
| @@ -10,6 +10,7 @@ class _ProcessUtils { |
| external static _exit(int status); |
| external static _setExitCode(int status); |
| external static _sleep(int millis); |
| + external static int _pid(Process process); |
| } |
| /** |
| @@ -54,6 +55,11 @@ void sleep(Duration duration) { |
| } |
| /** |
| + * Returns the PID if the current process. |
|
Anders Johnsen
2013/04/17 09:13:06
Move to Process.currentPid static getter?
Søren Gjesse
2013/04/17 10:15:12
I think the top level getter fits with the top lev
|
| + */ |
| +int get pid => _ProcessUtils._pid(null); |
| + |
| +/** |
| * [Process] is used to start new processes using the static |
| * [start] and [run] methods. |
| */ |
| @@ -118,6 +124,11 @@ abstract class Process { |
| IOSink get stdin; |
| /** |
| + * Returns the process id of the process. |
| + */ |
| + int get pid; |
| + |
| + /** |
| * Returns a [:Future:] which completes with the exit code of the process |
| * when the process completes. |
| * |
| @@ -162,6 +173,11 @@ abstract class ProcessResult { |
| * Standard error from the process as a string. |
| */ |
| String get stderr; |
| + |
| + /** |
| + * Process id from the process. |
| + */ |
| + int get pid; |
| } |