smpi_shared_malloc_bogusfile = mkstemp(name);
XBT_DEBUG("bogusfile : %s\n", name);
unlink(name);
- const char* dumb = new char[smpi_shared_malloc_blocksize](); // zero initialized
- ssize_t err = write(smpi_shared_malloc_bogusfile, dumb, smpi_shared_malloc_blocksize);
- if(err<0)
+ int err = posix_fallocate(smpi_shared_malloc_bogusfile, 0, smpi_shared_malloc_blocksize);
+ if (err != 0)
xbt_die("Could not write bogus file for shared malloc");
- delete[] dumb;
}
int mmap_base_flag = MAP_FIXED | MAP_SHARED | MAP_POPULATE;