\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$ \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 \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}
\hypertarget{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[{mmap(void $\ast$addr, size\+\_\+t len, int prot, int flags, int fd, off\+\_\+t offset)}]{\setlength{\rightskip}{0pt plus 5cm}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}
)}\label{group__Evil__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}


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\+E\+D}. If another value if given, -\/1 is returned.

{\ttfamily prot} specifies the protection of the mapped region. If P\+R\+O\+T\+\_\+\+E\+X\+E\+C is used, it set the execute access. If P\+R\+O\+T\+\_\+\+R\+E\+A\+D is used, it sets the read access. If P\+R\+O\+T\+\_\+\+W\+R\+I\+T\+E 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 O\+S\+: Windows Vista, Windows X\+P 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\+E\+D}. If another value if given, -\/1 is returned.

{\ttfamily prot} specifies the protection of the mapped region. If P\+R\+O\+T\+\_\+\+E\+X\+E\+C is used, it set the execute access. If P\+R\+O\+T\+\_\+\+R\+E\+A\+D is used, it sets the read access. If P\+R\+O\+T\+\_\+\+W\+R\+I\+T\+E 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. 

Referenced by eina\+\_\+file\+\_\+map\+\_\+all(), and eina\+\_\+file\+\_\+map\+\_\+new().

\hypertarget{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[{munmap(void $\ast$addr, size\+\_\+t len)}]{\setlength{\rightskip}{0pt plus 5cm}int munmap (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{addr, }
\item[{size\+\_\+t}]{len}
\end{DoxyParamCaption}
)}\label{group__Evil__Mman_ga01ff21bc70401bee9b80c350763087f7}


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 \hyperlink{group__Escape__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}{mmap()}. The parameter {\ttfamily len} is unsed.

Conformity\+: None.

Supported O\+S\+: Windows Vista, Windows X\+P 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 \hyperlink{group__Escape__Mman_ga1a69b9ee2b96ed0934c9f9c433f348ce}{mmap()}. The parameter {\ttfamily len} is unsed.

Conformity\+: None. 

Referenced by eina\+\_\+file\+\_\+map\+\_\+free().

