From 341e1dad1b97854af182b0b5293a02c553e9a033 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 5 Oct 2004 00:46:21 +0000 Subject: [PATCH] Solaris doesn't have MAP_FILE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16682 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/Unix/MappedFile.cpp | 5 ++++- lib/System/Unix/MappedFile.inc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/System/Unix/MappedFile.cpp b/lib/System/Unix/MappedFile.cpp index d853acec4f4..7682c23fda1 100644 --- a/lib/System/Unix/MappedFile.cpp +++ b/lib/System/Unix/MappedFile.cpp @@ -76,7 +76,10 @@ void MappedFile::unmap() { 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 d853acec4f4..7682c23fda1 100644 --- a/lib/System/Unix/MappedFile.inc +++ b/lib/System/Unix/MappedFile.inc @@ -76,7 +76,10 @@ void MappedFile::unmap() { 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;