\doxysubsection{Functions that manage memory mappping.}
\hypertarget{group__Evil__Mman}{}\label{group__Evil__Mman}\index{Functions that manage memory mappping.@{Functions that manage memory mappping.}}
\doxysubsubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EVIL\+\_\+\+API void \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__Evil__Mman_ga154607aa818931eddbf0bdf21ee4dc61}{mmap}} (void \texorpdfstring{$\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 
EVIL\+\_\+\+API int \mbox{\hyperlink{group__Evil__Mman_gaee9b4343ae30d988ed11c979c814a258}{munmap}} (void \texorpdfstring{$\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 
EVIL\+\_\+\+API int \mbox{\hyperlink{group__Evil__Mman_ga788d3e5f047b7494fffdaef2c3c9dba2}{mprotect}} (void \texorpdfstring{$\ast$}{*}addr, size\+\_\+t len, int prot)
\begin{DoxyCompactList}\small\item\em Changes protection for the calling process\textquotesingle{} address. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}


This header provides the meomry map functions mmap and munmap. 

\doxysubsubsection{Function Documentation}
\Hypertarget{group__Evil__Mman_ga154607aa818931eddbf0bdf21ee4dc61}\label{group__Evil__Mman_ga154607aa818931eddbf0bdf21ee4dc61} 
\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.}}
\doxysubsubsubsection{\texorpdfstring{mmap()}{mmap()}}
{\footnotesize\ttfamily EVIL\+\_\+\+API void \texorpdfstring{$\ast$}{*} mmap (\begin{DoxyParamCaption}\item[{void \texorpdfstring{$\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 MAP\+\_\+\+SHARED}. If another value if given, -\/1 is returned.

{\ttfamily prot} specifies the protection of the mapped region. If PROT\+\_\+\+EXEC is used, it set the execute access. If PROT\+\_\+\+READ is used, it sets the read access. If PROT\+\_\+\+WRITE 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. \Hypertarget{group__Evil__Mman_gaee9b4343ae30d988ed11c979c814a258}\label{group__Evil__Mman_gaee9b4343ae30d988ed11c979c814a258} 
\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.}}
\doxysubsubsubsection{\texorpdfstring{munmap()}{munmap()}}
{\footnotesize\ttfamily EVIL\+\_\+\+API int munmap (\begin{DoxyParamCaption}\item[{void \texorpdfstring{$\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 \doxylink{group__Evil__Mman_ga154607aa818931eddbf0bdf21ee4dc61}{mmap()}. The parameter {\ttfamily len} is unused.

Conformity\+: None.

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

Referenced by \mbox{\hyperlink{group__Eina__File__Group_gaf52b237fec73dbbcd411c8f999c5b5df}{eina\+\_\+file\+\_\+map\+\_\+free()}}.

\Hypertarget{group__Evil__Mman_ga788d3e5f047b7494fffdaef2c3c9dba2}\label{group__Evil__Mman_ga788d3e5f047b7494fffdaef2c3c9dba2} 
\index{Functions that manage memory mappping.@{Functions that manage memory mappping.}!mprotect@{mprotect}}
\index{mprotect@{mprotect}!Functions that manage memory mappping.@{Functions that manage memory mappping.}}
\doxysubsubsubsection{\texorpdfstring{mprotect()}{mprotect()}}
{\footnotesize\ttfamily EVIL\+\_\+\+API int mprotect (\begin{DoxyParamCaption}\item[{void \texorpdfstring{$\ast$}{*}}]{addr,  }\item[{size\+\_\+t}]{len,  }\item[{int}]{prot }\end{DoxyParamCaption})}



Changes protection for the calling process\textquotesingle{} address. 


\begin{DoxyParams}{Parameters}
{\em addr} & Pointer to the base address. \\
\hline
{\em len} & Length of the memory. \\
\hline
{\em prot} & New protection. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise.
\end{DoxyReturn}
Changes protection for the calling process\textquotesingle{} memory page. {\ttfamily addr} must be a valid adress in the user space. {\ttfamily prot} must be compatible with the old protection.

Conformity\+: None.

Supported OS\+: Windows Vista 