From 2660791c236676f28cdbf81da5c0d52110b36d17 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Fri, 19 Dec 2008 20:22:03 +0000 Subject: QPID-1412 - c++ implementation of the QMF client API git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@728132 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/SystemInfo.h | 11 +++++++++++ cpp/src/qpid/sys/posix/SystemInfo.cpp | 12 ++++++++++++ 2 files changed, 23 insertions(+) (limited to 'cpp/src/qpid/sys') diff --git a/cpp/src/qpid/sys/SystemInfo.h b/cpp/src/qpid/sys/SystemInfo.h index 5a116cf8ee..d43fe34b04 100644 --- a/cpp/src/qpid/sys/SystemInfo.h +++ b/cpp/src/qpid/sys/SystemInfo.h @@ -63,6 +63,17 @@ namespace SystemInfo { std::string &version, std::string &machine); + /** + * Get the process ID of the current process. + */ + uint32_t getProcessId(); + + /** + * Get the process ID of the parent of the current process. + */ + uint32_t getParentProcessId(); + + }}} // namespace qpid::sys::SystemInfo #endif /*!QPID_SYS_SYSTEMINFO_H*/ diff --git a/cpp/src/qpid/sys/posix/SystemInfo.cpp b/cpp/src/qpid/sys/posix/SystemInfo.cpp index 9bbd023e29..938d4861c4 100755 --- a/cpp/src/qpid/sys/posix/SystemInfo.cpp +++ b/cpp/src/qpid/sys/posix/SystemInfo.cpp @@ -94,4 +94,16 @@ void SystemInfo::getSystemId (std::string &osName, } } +uint32_t SystemInfo::getProcessId() +{ + return (uint32_t) ::getpid(); +} + +uint32_t SystemInfo::getParentProcessId() +{ + return (uint32_t) ::getppid(); +} + + + }} // namespace qpid::sys -- cgit v1.2.1