00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ACE_OS_INCLUDE_SYS_OS_MMAN_H
00017 #define ACE_OS_INCLUDE_SYS_OS_MMAN_H
00018
00019 #include "ace/pre.h"
00020
00021 #include "ace/config-lite.h"
00022
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif
00026
00027 #include "ace/os_include/sys/os_types.h"
00028
00029 #if defined (ACE_LACKS_MMAP)
00030 # define ACE_LACKS_SYS_MMAN_H
00031 #endif
00032
00033 #if !defined (ACE_LACKS_SYS_MMAN_H)
00034
00035 # if defined (ACE_HAS_BROKEN_MMAP_H)
00036 extern "C" {
00037 # endif
00038 # include <sys/mman.h>
00039 # if defined (ACE_HAS_BROKEN_MMAP_H)
00040 }
00041 # endif
00042 #endif
00043
00044
00045 #ifdef __cplusplus
00046 extern "C"
00047 {
00048 #endif
00049
00050 #if defined (ACE_LACKS_SYS_MMAN_H) && !defined (ACE_WIN32)
00051 # define PROT_READ 0
00052 # define PROT_WRITE 0
00053 # define PROT_EXEC 0
00054 # define PROT_NONE 0
00055 # define PROT_RDWR 0
00056 # define MAP_PRIVATE 0
00057 # define MAP_SHARED 0
00058 # define MAP_FIXED 0
00059 #elif defined (ACE_WIN32)
00060
00061 # define MAP_PRIVATE 1
00062 # define MAP_SHARED 2
00063 # define MAP_FIXED 4
00064
00065 # define PROT_READ PAGE_READONLY
00066 # define PROT_WRITE PAGE_READWRITE
00067 # define PROT_RDWR PAGE_READWRITE
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 #endif
00078
00079 # if !defined (ACE_MAP_PRIVATE)
00080 # define ACE_MAP_PRIVATE MAP_PRIVATE
00081 # endif
00082
00083 # if !defined (ACE_MAP_SHARED)
00084 # define ACE_MAP_SHARED MAP_SHARED
00085 # endif
00086
00087 # if !defined (ACE_MAP_FIXED)
00088 # define ACE_MAP_FIXED MAP_FIXED
00089 # endif
00090
00091 # if !defined (MAP_FAILED) || defined (ACE_HAS_BROKEN_MAP_FAILED)
00092 # undef MAP_FAILED
00093 # define MAP_FAILED ((void *) -1)
00094 # elif defined (ACE_HAS_LONG_MAP_FAILED)
00095 # undef MAP_FAILED
00096 # define MAP_FAILED ((void *) -1L)
00097 # endif
00098
00099 #if !defined (PROT_RDWR)
00100 # define PROT_RDWR (PROT_READ|PROT_WRITE)
00101 #endif
00102
00103 # if defined (ACE_WIN32)
00104
00105 # define MS_ASYNC 0
00106 # define MS_INVALIDATE 0
00107 # endif
00108
00109 # if !defined (MS_SYNC)
00110 # define MS_SYNC 0x0
00111 # endif
00112
00113 #if !defined (ACE_LACKS_MADVISE) && defined (ACE_LACKS_MADVISE_PROTOTYPE)
00114 extern "C" int madvise(caddr_t, size_t, int);
00115 #endif
00116
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120
00121 #include "ace/post.h"
00122 #endif