-
Notifications
You must be signed in to change notification settings - Fork 4
/
ProcMaps.h
49 lines (39 loc) · 821 Bytes
/
ProcMaps.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* SPDX-License-Identifier: GPL-2.0
*
* Copyright (c) 2018 Intel Corporation
*
* Authors: Fengguang Wu <[email protected]>
* Yao Yuan <[email protected]>
*/
#ifndef AEP_PROC_MAPS_H
#define AEP_PROC_MAPS_H
// interface to /proc/PID/maps
#include <sys/types.h>
#include <string>
#include <vector>
struct proc_maps_entry
{
unsigned long start;
unsigned long end;
char perms[5];
bool read;
bool write;
bool exec;
bool mayshare;
unsigned long offset;
int dev_major;
int dev_minor;
unsigned long ino;
std::string path;
};
class ProcMaps
{
public:
std::vector<proc_maps_entry> load(pid_t pid);
void show(const std::vector<proc_maps_entry>& maps);
void show(const proc_maps_entry &vma);
bool is_anonymous(proc_maps_entry& vma);
};
#endif
// vim:set ts=2 sw=2 et: