Solaris doesn't have MAP_FILE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16682 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Unix/MappedFile.cpp b/lib/System/Unix/MappedFile.cpp
index d853ace..7682c23 100644
--- a/lib/System/Unix/MappedFile.cpp
+++ b/lib/System/Unix/MappedFile.cpp
@@ -76,7 +76,10 @@
void* MappedFile::map() {
if (!isMapped()) {
int prot = PROT_NONE;
- int flags = MAP_FILE;
+ int flags = 0;
+#ifdef MAP_FILE
+ flags |= MAP_FILE;
+#endif
if (options_ == 0) {
prot = PROT_READ;
flags = MAP_PRIVATE;
diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc
index d853ace..7682c23 100644
--- a/lib/System/Unix/MappedFile.inc
+++ b/lib/System/Unix/MappedFile.inc
@@ -76,7 +76,10 @@
void* MappedFile::map() {
if (!isMapped()) {
int prot = PROT_NONE;
- int flags = MAP_FILE;
+ int flags = 0;
+#ifdef MAP_FILE
+ flags |= MAP_FILE;
+#endif
if (options_ == 0) {
prot = PROT_READ;
flags = MAP_PRIVATE;