|
|
|
@ -9,6 +9,9 @@
|
|
|
|
|
#include <cstring>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
|
#include <filesystem.h>
|
|
|
|
|
|
|
|
|
|
namespace fs = ghc::filesystem;
|
|
|
|
|
|
|
|
|
|
std::string read_line(const std::string& filename)
|
|
|
|
|
{
|
|
|
|
@ -181,4 +184,18 @@ std::string get_config_dir()
|
|
|
|
|
return path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool lib_loaded(const std::string& lib) {
|
|
|
|
|
fs::path path("/proc/self/map_files/");
|
|
|
|
|
for (auto& p : fs::directory_iterator(path)) {
|
|
|
|
|
auto file = p.path().string();
|
|
|
|
|
auto sym = read_symlink(file.c_str());
|
|
|
|
|
if (sym.find(lib) != std::string::npos) {
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // __linux__
|
|
|
|
|