Skip to content

Commit 40b806a

Browse files
committed
pal: Remove usage of MAP_FILE
This flag is a compatibility flag and not required on most OSes. Some, including Haiku, does not even define it.
1 parent 84a1502 commit 40b806a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/coreclr/pal/src/map/map.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ MAPmmapAndRecord(
108108
#define MAP_ANON MAP_ANONYMOUS
109109
#endif
110110

111-
/* Some platforms like Haiku does not provide MAP_FILE */
112-
#ifndef MAP_FILE
113-
#define MAP_FILE 0
114-
#endif
115-
116111
void
117112
FileMappingCleanupRoutine(
118113
CPalThread *pThread,
@@ -2115,7 +2110,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
21152110
#endif
21162111
SIZE_T reserveSize = 0;
21172112
bool forceOveralign = false;
2118-
int readWriteFlags = MAP_FILE|MAP_PRIVATE|MAP_FIXED;
2113+
int readWriteFlags = MAP_PRIVATE|MAP_FIXED;
21192114
int readOnlyFlags = readWriteFlags;
21202115

21212116
ENTRY("MAPMapPEFile (hFile=%p offset=%zx)\n", hFile, offset);
@@ -2322,7 +2317,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
23222317
// If PAL_MAP_READONLY_PE_HUGE_PAGE_AS_SHARED is set to 1. map the readonly sections as shared
23232318
// which works well with the behavior of the hugetlbfs
23242319
if (mapAsShared != NULL && (strcmp(mapAsShared, "1") == 0))
2325-
readOnlyFlags = MAP_FILE|MAP_SHARED|MAP_FIXED;
2320+
readOnlyFlags = MAP_SHARED|MAP_FIXED;
23262321
}
23272322

23282323
//we have now reserved memory (potentially we got rebased). Walk the PE sections and map each part

0 commit comments

Comments
 (0)