From: Augustin Degomme Date: Thu, 16 Feb 2017 23:15:52 +0000 (+0100) Subject: warning --, and ignore map_populate when not implemented (linux only, but just adviso... X-Git-Tag: v3_15~339 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6135eea71e3f38292e9da828bdcf04eb110509fe warning --, and ignore map_populate when not implemented (linux only, but just advisory, so let's follow https://gnu.org/software/hurd/glibc/mmap.html) --- diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index 95a1e4e309..b7b7c6df0e 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -40,6 +40,10 @@ #define MAP_ANONYMOUS MAP_ANON #endif +#ifndef MAP_POPULATE +#define MAP_POPULATE 0 +#endif + XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (benchmarking)"); /* Shared allocations are handled through shared memory segments. @@ -607,7 +611,9 @@ void *smpi_shared_malloc(size_t size, const char *file, int line) unlink(name); free(name); char* dumb = (char*)calloc(1, smpi_shared_malloc_blocksize); - write(smpi_shared_malloc_bogusfile, dumb, smpi_shared_malloc_blocksize); + ssize_t err = write(smpi_shared_malloc_bogusfile, dumb, smpi_shared_malloc_blocksize); + if(err<0) + xbt_die("could ot write bogus file for shared malloc"); free(dumb); }