#include "xbt/dict.h"
#include "xbt/sysdep.h"
#include "xbt/ex.h"
-#include "xbt/hash.h"
#include "surf/surf.h"
#include "simgrid/sg_config.h"
#include "simgrid/modelchecker.h"
if (res.second) {
// 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);
+ char shmname[32]; // cannot be longer than PSHMNAMLEN = 31 on Mac OS X (shm_open raises ENAMETOOLONG otherwise)
+ snprintf(shmname, 31, "/shmalloc%p", &*data);
fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd < 0) {