From: Gabriel Corona Date: Tue, 1 Mar 2016 08:43:28 +0000 (+0100) Subject: [smpi] Fix ENAMETOOLONG with shm_open in smpi_shared_malloc on MacOS X X-Git-Tag: v3_13~612 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b15867905d6e6505983a660ab1e024e35d1fa342 [smpi] Fix ENAMETOOLONG with shm_open in smpi_shared_malloc on MacOS X Max length is PSHMNAMLEN = 31. --- diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index 516d22af95..21f2fd0b5c 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -490,7 +490,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line) // The insertion did not take place. // Generate a shared memory name from the address of the shared_data: char shmname[256]; - sprintf(shmname, "/smpi_shared_malloc_%p", &*data); + sprintf(shmname, "/shmalloc%p", &*data); fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd < 0) {