8 int main(int argc, char * argv[]) {
10 std::cerr << "usage: " << argv[0] << ": libname\n";
13 std::regex reg(std::string("^([a-f0-9]+)\\-[0-9a-f]+\\s+.+\\s+(\\d+)\\s+.+\\s+\\d+\\s+") + std::string(argv[1]) + std::string("\\s*$"));
15 /* open /proc/self/maps */
17 std::ifstream m_file("/proc/self/maps");
19 std::cerr << "Unable to open /proc/self/maps " << strerror(errno) << "\n";
22 while (getline(m_file, ln)) {
24 if (std::regex_match (ln,sm, reg)) {
25 if (std::stoi(sm[2]) == 0) {