Map our Vma flags bitfield back to the rwxp string used by /proc/PID/maps.
| 89 | |
| 90 | // Map our Vma flags bitfield back to the rwxp string used by /proc/PID/maps. |
| 91 | void perm_string(const Vma& v, char buf[5]) { |
| 92 | buf[0] = v.readable() ? 'r' : '-'; |
| 93 | buf[1] = v.writable() ? 'w' : '-'; |
| 94 | buf[2] = v.executable() ? 'x' : '-'; |
| 95 | buf[3] = 'p'; // private mappings; we don't reliably distinguish shared yet |
| 96 | buf[4] = '\0'; |
| 97 | } |
| 98 | |
| 99 | } // anonymous |
| 100 |
no test coverage detected