\hypertarget{mman_8h}{}\doxysection{mman.\+h File Reference}
\label{mman_8h}\index{mman.h@{mman.h}}


The file that provides the memory map functions.  


\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{mman_8h_a6a982b48b8d3eb8eccd17e0d54ee5379}{P\+R\+O\+T\+\_\+\+N\+O\+NE}}~0x00
\item 
\#define \mbox{\hyperlink{mman_8h_a15bf68ce8b590838b3a5c0b639d8d519}{P\+R\+O\+T\+\_\+\+R\+E\+AD}}~0x01
\item 
\#define \mbox{\hyperlink{mman_8h_a2a79c8ceefb8fc25a940ae07a3d94429}{P\+R\+O\+T\+\_\+\+W\+R\+I\+TE}}~0x02
\item 
\#define \mbox{\hyperlink{mman_8h_a77848f068638e916c72cd543f5ecb815}{P\+R\+O\+T\+\_\+\+E\+X\+EC}}~0x04
\item 
\#define \mbox{\hyperlink{mman_8h_a57028962c2a7c0c802ca6613492f2ef3}{M\+A\+P\+\_\+\+S\+H\+A\+R\+ED}}~0x0001
\item 
\#define \mbox{\hyperlink{mman_8h_a398ef47a991a44389aa9818c98a28d24}{M\+A\+P\+\_\+\+P\+R\+I\+V\+A\+TE}}~0x0002
\item 
\#define \mbox{\hyperlink{mman_8h_a387ec707b30c5e78cf20a14517a63b96}{M\+A\+P\+\_\+\+F\+I\+X\+ED}}~0x0010
\item 
\#define \mbox{\hyperlink{mman_8h_a8523dcf952f6ff059a3bed717e4f1296}{M\+A\+P\+\_\+\+F\+A\+I\+L\+ED}}~((void $\ast$)-\/1)
\item 
\mbox{\Hypertarget{mman_8h_aec65c6c4c9adf80f22eb745a10a92dc8}\label{mman_8h_aec65c6c4c9adf80f22eb745a10a92dc8}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+N\+O\+R\+M\+AL}~0     /$\ast$ No further special treatment.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_ad20f68fbbd6999164c918398dd1df993}\label{mman_8h_ad20f68fbbd6999164c918398dd1df993}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+R\+A\+N\+D\+OM}~1     /$\ast$ Expect random page references.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_a5251e8fa4acd2123079bd04ef1c01955}\label{mman_8h_a5251e8fa4acd2123079bd04ef1c01955}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+S\+E\+Q\+U\+E\+N\+T\+I\+AL}~2     /$\ast$ Expect sequential page references.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_adeeef1f5349095dcbfdf2df0dea3e41b}\label{mman_8h_adeeef1f5349095dcbfdf2df0dea3e41b}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+W\+I\+L\+L\+N\+E\+ED}~3     /$\ast$ Will need these pages.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_adef2b7285968a843b78ba48fcd4d8c03}\label{mman_8h_adef2b7285968a843b78ba48fcd4d8c03}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+D\+O\+N\+T\+N\+E\+ED}~4     /$\ast$ Don\textquotesingle{}t need these pages.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_aff85c2bef6cd8ec94cdf4c1225c00788}\label{mman_8h_aff85c2bef6cd8ec94cdf4c1225c00788}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+R\+E\+M\+O\+VE}~9     /$\ast$ Remove these pages and resources.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_a46ab238c02eddbb716afa3f75f0c0e57}\label{mman_8h_a46ab238c02eddbb716afa3f75f0c0e57}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+D\+O\+N\+T\+F\+O\+RK}~10    /$\ast$ Do not inherit across fork.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_a9182086f38d03252487ca39eb27b6214}\label{mman_8h_a9182086f38d03252487ca39eb27b6214}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+D\+O\+F\+O\+RK}~11    /$\ast$ Do inherit across fork.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_ae895a11e20bb8d2045b67506c6bcc24b}\label{mman_8h_ae895a11e20bb8d2045b67506c6bcc24b}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+M\+E\+R\+G\+E\+A\+B\+LE}~12    /$\ast$ K\+SM may merge identical pages.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_a38553c43b04d29cc61ea0d4eb517d014}\label{mman_8h_a38553c43b04d29cc61ea0d4eb517d014}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+U\+N\+M\+E\+R\+G\+E\+A\+B\+LE}~13    /$\ast$ K\+SM may not merge identical pages.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_a3ba88eedc79ae8b5686d19b8635c66ca}\label{mman_8h_a3ba88eedc79ae8b5686d19b8635c66ca}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+H\+U\+G\+E\+P\+A\+GE}~14    /$\ast$ Worth backing with hugepages.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_a57cdc8dddbe3e303aa8a7edd6e5d3ff0}\label{mman_8h_a57cdc8dddbe3e303aa8a7edd6e5d3ff0}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+N\+O\+H\+U\+G\+E\+P\+A\+GE}~15    /$\ast$ Not worth backing with hugepages.  $\ast$/
\item 
\mbox{\Hypertarget{mman_8h_af65c5754e74f5dfdc7d690e120ae69c0}\label{mman_8h_af65c5754e74f5dfdc7d690e120ae69c0}} 
\#define {\bfseries M\+A\+D\+V\+\_\+\+H\+W\+P\+O\+I\+S\+ON}~100   /$\ast$ Poison a page for testing.  $\ast$/
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \mbox{\hyperlink{group__Escape__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}{mmap}} (void $\ast$addr, size\+\_\+t len, int prot, int flags, int fd, off\+\_\+t offset)
\begin{DoxyCompactList}\small\item\em Creates or opens a named or unnamed file mapping object for a specified file and maps a view of a file mapping into the address space of a calling process. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Escape__Mman_ga01ff21bc70401bee9b80c350763087f7}{munmap}} (void $\ast$addr, size\+\_\+t len)
\begin{DoxyCompactList}\small\item\em Unmaps a mapped view of a file from the calling process\textquotesingle{}s address space. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Escape__Mman_gac1842269384644cb3cf52919b6a0c014}{madvise}} (void $\ast$addr, size\+\_\+t length, int advice)
\begin{DoxyCompactList}\small\item\em give advice about use of memory \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The file that provides the memory map functions. 



\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{mman_8h_a6a982b48b8d3eb8eccd17e0d54ee5379}\label{mman_8h_a6a982b48b8d3eb8eccd17e0d54ee5379}} 
\index{mman.h@{mman.h}!PROT\_NONE@{PROT\_NONE}}
\index{PROT\_NONE@{PROT\_NONE}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{PROT\_NONE}{PROT\_NONE}}
{\footnotesize\ttfamily \#define P\+R\+O\+T\+\_\+\+N\+O\+NE~0x00}

Data can not be accessed. \mbox{\Hypertarget{mman_8h_a15bf68ce8b590838b3a5c0b639d8d519}\label{mman_8h_a15bf68ce8b590838b3a5c0b639d8d519}} 
\index{mman.h@{mman.h}!PROT\_READ@{PROT\_READ}}
\index{PROT\_READ@{PROT\_READ}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{PROT\_READ}{PROT\_READ}}
{\footnotesize\ttfamily \#define P\+R\+O\+T\+\_\+\+R\+E\+AD~0x01}

Data can be read. \mbox{\Hypertarget{mman_8h_a2a79c8ceefb8fc25a940ae07a3d94429}\label{mman_8h_a2a79c8ceefb8fc25a940ae07a3d94429}} 
\index{mman.h@{mman.h}!PROT\_WRITE@{PROT\_WRITE}}
\index{PROT\_WRITE@{PROT\_WRITE}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{PROT\_WRITE}{PROT\_WRITE}}
{\footnotesize\ttfamily \#define P\+R\+O\+T\+\_\+\+W\+R\+I\+TE~0x02}

Data can be written. \mbox{\Hypertarget{mman_8h_a77848f068638e916c72cd543f5ecb815}\label{mman_8h_a77848f068638e916c72cd543f5ecb815}} 
\index{mman.h@{mman.h}!PROT\_EXEC@{PROT\_EXEC}}
\index{PROT\_EXEC@{PROT\_EXEC}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{PROT\_EXEC}{PROT\_EXEC}}
{\footnotesize\ttfamily \#define P\+R\+O\+T\+\_\+\+E\+X\+EC~0x04}

Data can be executed. \mbox{\Hypertarget{mman_8h_a57028962c2a7c0c802ca6613492f2ef3}\label{mman_8h_a57028962c2a7c0c802ca6613492f2ef3}} 
\index{mman.h@{mman.h}!MAP\_SHARED@{MAP\_SHARED}}
\index{MAP\_SHARED@{MAP\_SHARED}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{MAP\_SHARED}{MAP\_SHARED}}
{\footnotesize\ttfamily \#define M\+A\+P\+\_\+\+S\+H\+A\+R\+ED~0x0001}

Changes are shared. \mbox{\Hypertarget{mman_8h_a398ef47a991a44389aa9818c98a28d24}\label{mman_8h_a398ef47a991a44389aa9818c98a28d24}} 
\index{mman.h@{mman.h}!MAP\_PRIVATE@{MAP\_PRIVATE}}
\index{MAP\_PRIVATE@{MAP\_PRIVATE}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{MAP\_PRIVATE}{MAP\_PRIVATE}}
{\footnotesize\ttfamily \#define M\+A\+P\+\_\+\+P\+R\+I\+V\+A\+TE~0x0002}

Changes are private. \mbox{\Hypertarget{mman_8h_a387ec707b30c5e78cf20a14517a63b96}\label{mman_8h_a387ec707b30c5e78cf20a14517a63b96}} 
\index{mman.h@{mman.h}!MAP\_FIXED@{MAP\_FIXED}}
\index{MAP\_FIXED@{MAP\_FIXED}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{MAP\_FIXED}{MAP\_FIXED}}
{\footnotesize\ttfamily \#define M\+A\+P\+\_\+\+F\+I\+X\+ED~0x0010}

Interpret the address (addr) exactly. \mbox{\Hypertarget{mman_8h_a8523dcf952f6ff059a3bed717e4f1296}\label{mman_8h_a8523dcf952f6ff059a3bed717e4f1296}} 
\index{mman.h@{mman.h}!MAP\_FAILED@{MAP\_FAILED}}
\index{MAP\_FAILED@{MAP\_FAILED}!mman.h@{mman.h}}
\doxysubsubsection{\texorpdfstring{MAP\_FAILED}{MAP\_FAILED}}
{\footnotesize\ttfamily \#define M\+A\+P\+\_\+\+F\+A\+I\+L\+ED~((void $\ast$)-\/1)}

Error return from \mbox{\hyperlink{group__Escape__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}{mmap()}}. 