From 80bd99de44f05e77327a70e6f6c2c69fc25bf7e8 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 21 Sep 2016 11:20:53 +0200 Subject: [PATCH] Added statExchange getPID function --- lib/shared_memory.cpp | 5 +++++ lib/shared_memory.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/shared_memory.cpp b/lib/shared_memory.cpp index 7c98dd70..4ceae195 100644 --- a/lib/shared_memory.cpp +++ b/lib/shared_memory.cpp @@ -721,6 +721,11 @@ namespace IPC { return data[172]; } + ///\brief Gets PID field + uint32_t statExchange::getPID() { + return *(uint32_t*)(data+173); + } + ///\brief Creates a semaphore guard, locks the semaphore on call semGuard::semGuard(semaphore * thisSemaphore) : mySemaphore(thisSemaphore) { mySemaphore->wait(); diff --git a/lib/shared_memory.h b/lib/shared_memory.h index bc0fe13c..21d0ed39 100644 --- a/lib/shared_memory.h +++ b/lib/shared_memory.h @@ -40,6 +40,7 @@ namespace IPC { char getSync(); void setSync(char s); unsigned int crc(); + uint32_t getPID(); private: ///\brief The payload for the stat exchange /// - 8 byte - now (timestamp of last statistics)