![]() |
|||||
|
00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: sys/mman.h 00003 * 00004 * Purpose: Declaration of the mmap() and munmap() API functions. 00005 * 00006 * Created: 18th December 2003 00007 * Updated: 13th August 2010 00008 * 00009 * Home: http://synesis.com.au/software/ 00010 * 00011 * Copyright (c) 2003-2010, Matthew Wilson and Synesis Software 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are 00016 * met: 00017 * 00018 * - Redistributions of source code must retain the above copyright notice, 00019 * this list of conditions and the following disclaimer. 00020 * - Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the 00024 * names of any contributors may be used to endorse or promote products 00025 * derived from this software without specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 00028 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00029 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00030 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00031 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00032 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00033 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00034 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00035 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00036 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00037 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00038 * 00039 * ////////////////////////////////////////////////////////////////////// */ 00040 00041 00047 #ifndef SYNSOFT_UNIXEM_INCL_SYS_H_MMAP 00048 #define SYNSOFT_UNIXEM_INCL_SYS_H_MMAP 00049 00050 #ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION 00051 # define SYNSOFT_UNIXEM_VER_SYS_H_MMAP_MAJOR 3 00052 # define SYNSOFT_UNIXEM_VER_SYS_H_MMAP_MINOR 0 00053 # define SYNSOFT_UNIXEM_VER_SYS_H_MMAP_REVISION 1 00054 # define SYNSOFT_UNIXEM_VER_SYS_H_MMAP_EDIT 24 00055 #endif /* !UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00056 00057 /* ///////////////////////////////////////////////////////////////////////// 00058 * Includes 00059 */ 00060 00061 #include <unixem/sys/mman.h> 00062 00063 /* ////////////////////////////////////////////////////////////////////// */ 00064 00075 /* ////////////////////////////////////////////////////////////////////// */ 00076 00077 #ifndef _WIN32 00078 # error This file is only currently defined for compilation on Win32 systems 00079 #endif /* _WIN32 */ 00080 00081 /* ///////////////////////////////////////////////////////////////////////// 00082 * Constants and definitions 00083 */ 00084 00085 #define PROT_READ (UNIXEM_PROT_READ) 00086 #define PROT_WRITE (UNIXEM_PROT_WRITE) 00087 #define PROT_EXEC (UNIXEM_PROT_EXEC) 00088 #define PROT_NONE (UNIXEM_PROT_NONE) 00090 #define MAP_PRIVATE (UNIXEM_MAP_PRIVATE) 00091 #define MAP_ANONYMOUS (UNIXEM_MAP_ANONYMOUS) 00092 #define MAP_FIXED (UNIXEM_MAP_FIXED) 00094 #define MAP_FAILED (UNIXEM_MAP_FAILED) 00096 /* ///////////////////////////////////////////////////////////////////////// 00097 * API functions 00098 */ 00099 00100 #ifdef __cplusplus 00101 extern "C" 00102 { 00103 #endif /* __cplusplus */ 00104 00124 #ifdef UNIXEM_DOCUMENTATION_SKIP_SECTION 00125 void* mmap( 00126 void* addr 00127 , size_t len 00128 , int prot 00129 , int flags 00130 , int fd 00131 , off_t offset 00132 ); 00133 #else /* ? UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00134 # define mmap unixem_mmap 00135 #endif /* UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00136 00151 #ifdef UNIXEM_DOCUMENTATION_SKIP_SECTION 00152 int munmap( 00153 void* addr 00154 , size_t len 00155 ); 00156 #else /* ? UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00157 # define munmap unixem_munmap 00158 #endif /* UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00159 00169 #ifdef UNIXEM_DOCUMENTATION_SKIP_SECTION 00170 int msync( 00171 void* addr 00172 , size_t len 00173 , int flags 00174 ); 00175 #else /* ? UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00176 # define msync unixem_msync 00177 #endif /* UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00178 00179 00180 #ifdef __cplusplus 00181 } /* extern "C" */ 00182 #endif /* __cplusplus */ 00183 00184 /* ////////////////////////////////////////////////////////////////////// */ 00185 00188 /* ////////////////////////////////////////////////////////////////////// */ 00189 00190 #endif /* SYNSOFT_UNIXEM_INCL_SYS_H_MMAP */ 00191 00192 /* ///////////////////////////// end of file //////////////////////////// */
|
UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2002-2010 |