+#include <unistd.h>
+#include "paths.h"
+
+std::string get_exec_path()
+{
+ char pBuf[256];
+ size_t len = sizeof(pBuf);
+ char szTmp[32];
+
+ sprintf(szTmp, "/proc/%d/exe", getpid());
+ int bytes = readlink(szTmp, pBuf, len);
+ if (bytes > len - 1)
+ bytes = len - 1;
+ if (bytes >= 0)
+ pBuf[bytes] = '\0';
+
+ std::string exec_path = pBuf;
+ return exec_path.substr(0, exec_path.rfind(DIR_DELIM) + 1);
+}
+
+
+std::set<std::string> get_dm_paths() {
+ std::set<std::string> paths;
+
+ paths.insert(get_exec_path());
+
+ return paths;
+}