aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/process.cxx15
-rw-r--r--libbutl/process.hxx3
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.
//