Scans |proc_maps| starting from |pos| returning true if the gate VMA was found, otherwise returns false.
| 29 | // Scans |proc_maps| starting from |pos| returning true if the gate VMA was |
| 30 | // found, otherwise returns false. |
| 31 | static bool ContainsGateVMA(std::string* proc_maps, size_t pos) { |
| 32 | #if defined(ARCH_CPU_ARM_FAMILY) |
| 33 | // The gate VMA on ARM kernels is the interrupt vectors page. |
| 34 | return proc_maps->find(" [vectors]\n", pos) != std::string::npos; |
| 35 | #elif defined(ARCH_CPU_X86_64) |
| 36 | // The gate VMA on x86 64-bit kernels is the virtual system call page. |
| 37 | return proc_maps->find(" [vsyscall]\n", pos) != std::string::npos; |
| 38 | #else |
| 39 | // Otherwise assume there is no gate VMA in which case we shouldn't |
| 40 | // get duplicate entires. |
| 41 | return false; |
| 42 | #endif |
| 43 | } |
| 44 | |
| 45 | bool ReadProcMaps(std::string* proc_maps) { |
| 46 | // seq_file only writes out a page-sized amount on each call. Refer to header |