-/* Copyright (c) 2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <cstdint>
#include <climits>
+#include <cstring>
#include <vector>
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
-#include "simgrid/sg_config.h"
#include <fcntl.h>
+#include <sys/stat.h>
+#include <errno.h>
#ifndef WIN32
#include <sys/mman.h>
#include <unistd.h>
-#include "../xbt/memory_map.hpp"
+#include "src/xbt/memory_map.hpp"
#include "private.h"
#include "private.hpp"
int smpi_loaded_page = -1;
char* smpi_start_data_exe = nullptr;
int smpi_size_data_exe = 0;
-bool smpi_privatize_global_variables;
+int smpi_privatize_global_variables;
static const int PROT_RWX = (PROT_READ | PROT_WRITE | PROT_EXEC);
static const int PROT_RW = (PROT_READ | PROT_WRITE );
void* tmp =
mmap(TOPAGE(smpi_start_data_exe), smpi_size_data_exe, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, current, 0);
if (tmp != TOPAGE(smpi_start_data_exe))
- xbt_die("Couldn't map the new region");
+ xbt_die("Couldn't map the new region (errno %d): %s", errno, strerror(errno));
smpi_loaded_page = dest;
#endif
}