\hypertarget{group__Evil__Mman}{}\doxysection{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.  


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


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



\doxysubsection{Function Documentation}
\mbox{\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.}}
\doxysubsubsection{\texorpdfstring{mmap()}{mmap()}}
{\footnotesize\ttfamily EVIL\+\_\+\+API 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 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. 

Referenced by \mbox{\hyperlink{group__Ecore__Drm2__Fb__Group_ga72a7ba3a5cb45c37aa1e22e5e5ede22e}{ecore\+\_\+drm2\+\_\+fb\+\_\+create()}}, \mbox{\hyperlink{group__Eina__File__Group_gaae165c21af09fca39c2d1f89a92cb6b1}{eina\+\_\+file\+\_\+map\+\_\+all()}}, and \mbox{\hyperlink{group__Eina__File__Group_ga5c56a04cf4de6d43f73ce39b970132fa}{eina\+\_\+file\+\_\+map\+\_\+new()}}.

\mbox{\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.}}
\doxysubsubsection{\texorpdfstring{munmap()}{munmap()}}
{\footnotesize\ttfamily EVIL\+\_\+\+API 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__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()}}.

\mbox{\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.}}
\doxysubsubsection{\texorpdfstring{mprotect()}{mprotect()}}
{\footnotesize\ttfamily EVIL\+\_\+\+API int mprotect (\begin{DoxyParamCaption}\item[{void $\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 