summaryrefslogtreecommitdiff
path: root/src/pal/src
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2019-06-06 15:47:53 +0200
committerJan Kotas <jkotas@microsoft.com>2019-06-06 06:47:53 -0700
commit14a90253a34f49fd2bf1f17dd84ee6faa1db3af7 (patch)
tree31ad91971ad9712e5643c4d5a6b8e7eca35d1805 /src/pal/src
parent1a495118c005b9a5409c81fea1813bd2b3044cbd (diff)
downloadcoreclr-14a90253a34f49fd2bf1f17dd84ee6faa1db3af7.tar.gz
coreclr-14a90253a34f49fd2bf1f17dd84ee6faa1db3af7.tar.bz2
coreclr-14a90253a34f49fd2bf1f17dd84ee6faa1db3af7.zip
Fix tmp dir in configure.cmake (#25003)
The ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS check was using a temp path that had some non-existent components. While this works fine on Linux, it fails to create the temp file on OSX. The fix is to use temp dir in the CMake's output dir.
Diffstat (limited to 'src/pal/src')
-rw-r--r--src/pal/src/configure.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pal/src/configure.cmake b/src/pal/src/configure.cmake
index 066bd52097..4d00b72ba8 100644
--- a/src/pal/src/configure.cmake
+++ b/src/pal/src/configure.cmake
@@ -539,9 +539,10 @@ check_cxx_source_runs("
#include <string.h>
#include <sys/types.h>
#include <sys/mman.h>
+#include <algorithm>
#define MEM_SIZE 1024
-
+#define TEMP_FILE_TEMPLATE \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/multiplemaptestXXXXXX\"
int main(void)
{
char * fname;
@@ -549,10 +550,10 @@ int main(void)
int ret;
void * pAddr0, * pAddr1;
- fname = (char *)malloc(MEM_SIZE);
+ fname = (char *)malloc(std::max((size_t)MEM_SIZE, sizeof(TEMP_FILE_TEMPLATE)));
if (!fname)
exit(1);
- strcpy(fname, \"/tmp/name/multiplemaptestXXXXXX\");
+ strcpy(fname, TEMP_FILE_TEMPLATE);
fd = mkstemp(fname);
if (fd < 0)