diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-12 15:03:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-12 15:03:31 +0200 |
commit | 4b8511e2618c2813808011c228d22669945589e6 (patch) | |
tree | 01269cf3e653ad6312ac7ba7fca104364ffacd01 /butl/process.cxx | |
parent | 550b5257aba507bcce98f6832b8905769a14955d (diff) |
Add process::id(), make few minor fixes
Diffstat (limited to 'butl/process.cxx')
-rw-r--r-- | butl/process.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/butl/process.cxx b/butl/process.cxx index 74892e6..05c06f1 100644 --- a/butl/process.cxx +++ b/butl/process.cxx @@ -1121,6 +1121,17 @@ namespace butl } process::id_type process:: + id () const + { + id_type r (GetProcessId (handle)); + + if (r == 0) + throw process_error (last_error_msg ()); + + return r; + } + + process::id_type process:: current_id () { return GetCurrentProcessId (); |