Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix https://framagit.org/simgrid/simgrid/issues/28
[simgrid.git] / src / xbt / memory_map.hpp
1 /* Copyright (c) 2007-2019. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SIMGRID_XBT_MEMORY_MAP_HPP
8 #define SIMGRID_XBT_MEMORY_MAP_HPP
9
10 #include <cstdint>
11 #include <string>
12 #include <vector>
13
14 namespace simgrid {
15 namespace xbt {
16
17 /** An virtual memory map entry from /proc/$pid/maps */
18 struct VmMap {
19   std::uint64_t start_addr;
20   std::uint64_t end_addr;
21   int prot;                     /* Memory protection */
22   int flags;                    /* Additional memory flags */
23   std::uint64_t offset;         /* Offset in the file/whatever */
24   char dev_major;               /* Major of the device */
25   char dev_minor;               /* Minor of the device */
26   unsigned long inode;          /* Inode in the device */
27   std::string pathname;         /* Path name of the mapped file */
28 };
29
30 std::vector<VmMap> get_memory_map(pid_t pid);
31 }
32 }
33
34 #endif