summaryrefslogtreecommitdiffstats
path: root/occ_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'occ_device.cpp')
-rw-r--r--occ_device.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/occ_device.cpp b/occ_device.cpp
index 865aef2..8129502 100644
--- a/occ_device.cpp
+++ b/occ_device.cpp
@@ -1,3 +1,4 @@
+#include <iostream>
#include "occ_device.hpp"
namespace open_power
@@ -8,5 +9,21 @@ namespace occ
fs::path Device::bindPath = fs::path(OCC_HWMON_PATH) / "bind";
fs::path Device::unBindPath = fs::path(OCC_HWMON_PATH) / "unbind";
+bool Device::master() const
+{
+ int master;
+ auto masterFile = fs::path(DEV_PATH) / config / "occ_master";
+ std::ifstream file(masterFile, std::ios::in);
+
+ if (!file)
+ {
+ return false;
+ }
+
+ file >> master;
+ file.close();
+ return (master != 0);
+}
+
} // namespace occ
} // namespace open_power
OpenPOWER on IntegriCloud