\hypertarget{group__Evil__Mman}{}\section{Functions that manage memory mappping.}
\label{group__Evil__Mman}\index{Functions that manage memory mappping.@{Functions that manage memory mappping.}}


This header provides the meomry map functions mmap and munmap.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \mbox{\hyperlink{group__Evil__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__Evil__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}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This header provides the meomry map functions mmap and munmap. 



\subsection{Function Documentation}
\mbox{\Hypertarget{group__Evil__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}\label{group__Evil__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}} 
\index{Functions that manage memory mappping.@{Functions that manage memory mappping.}!mmap@{mmap}}
\index{mmap@{mmap}!Functions that manage memory mappping.@{Functions that manage memory mappping.}}
\subsubsection{\texorpdfstring{mmap()}{mmap()}}
{\footnotesize\ttfamily void$\ast$ mmap (\begin{DoxyParamCaption}\item[{void $\ast$}]{addr,  }\item[{size\+\_\+t}]{len,  }\item[{int}]{prot,  }\item[{int}]{flags,  }\item[{int}]{fd,  }\item[{off\+\_\+t}]{offset }\end{DoxyParamCaption})}



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. 


\begin{DoxyParams}{Parameters}
{\em addr} & Unused \\
\hline
{\em len} & Number of bytes to be mapped. \\
\hline
{\em prot} & Protections. \\
\hline
{\em flags} & Type of the mapped object. \\
\hline
{\em fd} & File descriptor that describes the object to map. \\
\hline
{\em offset} & Number of bytes from which to start the mapping. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The starting address of the mapped view on success, -\/1 otherwise.
\end{DoxyReturn}
Create or open an unnamed file mapping object for a specified file described by the file descriptor {\ttfamily fd}. The number of bytes that are mapped is given by {\ttfamily len} and start after {\ttfamily offset} bytes. The parameter {\ttfamily addr} is unused.

The only type of the mapped object that is supported is {\ttfamily M\+A\+P\+\_\+\+S\+H\+A\+R\+ED}. If another value if given, -\/1 is returned.

{\ttfamily prot} specifies the protection of the mapped region. If P\+R\+O\+T\+\_\+\+E\+X\+EC is used, it set the execute access. If P\+R\+O\+T\+\_\+\+R\+E\+AD is used, it sets the read access. If P\+R\+O\+T\+\_\+\+W\+R\+I\+TE is used, it sets the write access.

If the map view of file can not be created, -\/1 is returned. If the mappping can not be done, -\/1 is returned.

If no error occurred, the starting address of the mapped view is returned.

Conformity\+: None.

Supported OS\+: Windows Vista, Windows XP or Windows 2000 Professional.


\begin{DoxyParams}{Parameters}
{\em addr} & Unused \\
\hline
{\em len} & Number of bytes to be mapped. \\
\hline
{\em prot} & Protections. \\
\hline
{\em flags} & Type of the mapped object. \\
\hline
{\em fd} & File descriptor that describes the object to map. \\
\hline
{\em offset} & Number of bytes from which to start the mapping. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The starting address of the mapped view on success, -\/1 otherwise.
\end{DoxyReturn}
Create or open an unnamed file mapping object for a specified file described by the file descriptor {\ttfamily fd}. The number of bytes that are mapped is given by {\ttfamily len} and start after {\ttfamily offset} bytes. The parameter {\ttfamily addr} is unused.

The only type of the mapped object that is supported is {\ttfamily M\+A\+P\+\_\+\+S\+H\+A\+R\+ED}. If another value if given, -\/1 is returned.

{\ttfamily prot} specifies the protection of the mapped region. If P\+R\+O\+T\+\_\+\+E\+X\+EC is used, it set the execute access. If P\+R\+O\+T\+\_\+\+R\+E\+AD is used, it sets the read access. If P\+R\+O\+T\+\_\+\+W\+R\+I\+TE is used, it sets the write access.

If the map view of file can not be created, -\/1 is returned. If the mappping can not be done, -\/1 is returned.

If no error occurred, the starting address of the mapped view is returned.

Conformity\+: None. \mbox{\Hypertarget{group__Evil__Mman_ga01ff21bc70401bee9b80c350763087f7}\label{group__Evil__Mman_ga01ff21bc70401bee9b80c350763087f7}} 
\index{Functions that manage memory mappping.@{Functions that manage memory mappping.}!munmap@{munmap}}
\index{munmap@{munmap}!Functions that manage memory mappping.@{Functions that manage memory mappping.}}
\subsubsection{\texorpdfstring{munmap()}{munmap()}}
{\footnotesize\ttfamily int munmap (\begin{DoxyParamCaption}\item[{void $\ast$}]{addr,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}



Unmaps a mapped view of a file from the calling process\textquotesingle{}s address space. 


\begin{DoxyParams}{Parameters}
{\em addr} & Pointer to the base address. \\
\hline
{\em len} & Unused. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise.
\end{DoxyReturn}
Unmaps a mapped view of a file from the calling process\textquotesingle{}s address space. {\ttfamily addr} is the pointer to the base address. This value must be identical to the value returned by a previous call to \mbox{\hyperlink{group__Escape__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}{mmap()}}. The parameter {\ttfamily len} is unsed.

Conformity\+: None.

Supported OS\+: Windows Vista, Windows XP or Windows 2000 Professional.


\begin{DoxyParams}{Parameters}
{\em addr} & Pointer to the base address. \\
\hline
{\em len} & Unused. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise.
\end{DoxyReturn}
Unmaps a mapped view of a file from the calling process\textquotesingle{}s address space. {\ttfamily addr} is the pointer to the base address. This value must be identical to the value returned by a previous call to \mbox{\hyperlink{group__Escape__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}{mmap()}}. The parameter {\ttfamily len} is unsed.

Conformity\+: None. 