[sr-dev] git:master:5c4309e4: core: pt - helper function to get description for current process

Daniel-Constantin Mierla miconda at gmail.com
Tue Jan 2 12:22:59 CET 2018


Module: kamailio
Branch: master
Commit: 5c4309e47b0f66c3c4a98145a956bfe0b2ce0953
URL: https://github.com/kamailio/kamailio/commit/5c4309e47b0f66c3c4a98145a956bfe0b2ce0953

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-01-02T12:09:56+01:00

core: pt - helper function to get description for current process

---

Modified: src/core/pt.c
Modified: src/core/pt.h

---

Diff:  https://github.com/kamailio/kamailio/commit/5c4309e47b0f66c3c4a98145a956bfe0b2ce0953.diff
Patch: https://github.com/kamailio/kamailio/commit/5c4309e47b0f66c3c4a98145a956bfe0b2ce0953.patch

---

diff --git a/src/core/pt.c b/src/core/pt.c
index bec0869694..bf84df404a 100644
--- a/src/core/pt.c
+++ b/src/core/pt.c
@@ -195,6 +195,12 @@ int my_pid()
 }
 
 
+/* return processes description */
+char* my_desc(void)
+{
+	return pt ? pt[process_no].desc : "unknown";
+}
+
 
 /* close unneeded sockets */
 int close_extra_socks(int child_id, int proc_no)
diff --git a/src/core/pt.h b/src/core/pt.h
index ed351a7b99..6b170d34e6 100644
--- a/src/core/pt.h
+++ b/src/core/pt.h
@@ -64,6 +64,9 @@ int close_extra_socks(int proc_id, int proc_no);
 /* return processes pid */
 int my_pid(void);
 
+/* return processes description */
+char* my_desc(void);
+
 /**
  * Forks a new process.
  * @param desc - text description for the process table




More information about the sr-dev mailing list