diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-10 10:50:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-10 10:50:54 +0200 |
commit | b6706518054efa9440c8b5b43412e95ad0e73f89 (patch) | |
tree | a2c97233ca797d35a2d078ad452989e9d702042e | |
parent | b0bf46a7942611729dd8d9d8b8d78cedf26c4685 (diff) |
Add process::current_handle()
-rw-r--r-- | libbutl/process.cxx | 15 | ||||
-rw-r--r-- | libbutl/process.hxx | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libbutl/process.cxx b/libbutl/process.cxx index 0bfff03..e416807 100644 --- a/libbutl/process.cxx +++ b/libbutl/process.cxx @@ -846,6 +846,12 @@ namespace butl return getpid (); } + process::handle_type process:: + current_handle () + { + return getpid (); + } + // process_exit // process_exit:: @@ -2078,6 +2084,15 @@ namespace butl return GetCurrentProcessId (); } + process::handle_type process:: + current_handle () + { + // Note that the returned handle is a pseudo handle (-1) that does not + // need to be closed. + // + return GetCurrentProcess (); + } + // process_exit // process_exit:: diff --git a/libbutl/process.hxx b/libbutl/process.hxx index 5a6837f..bbb7c89 100644 --- a/libbutl/process.hxx +++ b/libbutl/process.hxx @@ -629,6 +629,9 @@ namespace butl public: handle_type handle; + static handle_type + current_handle (); + // Absence means that the exit information is not (yet) known. This can be // because you haven't called wait() yet or because wait() failed. // |