aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/gnunet_os_lib.h9
-rw-r--r--src/util/os_priority.c12
2 files changed, 21 insertions, 0 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index bb29e89df8..5ff2b48633 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -204,6 +204,15 @@ int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig);
*/
void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc);
+/**
+ * Get the pid of the process in question
+ *
+ * @param proc the process to get the pid of
+ *
+ * @return the current process id
+ */
+pid_t
+GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
/**
* Set process priority
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 5f78e21798..1b506fec2e 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -101,6 +101,18 @@ GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig)
#endif
}
+/**
+ * Get the pid of the process in question
+ *
+ * @param proc the process to get the pid of
+ *
+ * @return the current process id
+ */
+pid_t
+GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc)
+{
+ return proc->pid;
+}
void
GNUNET_OS_process_close (struct GNUNET_OS_Process *proc)