X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/083e5bc3e59e935868789304e8bc5d906000a173..e0ba02850ce33d8eda9ba10a68db10af76f0ef29:/src/smpi/smpi_global.cpp?ds=sidebyside diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index cf5d34206c..5910e15e82 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -570,11 +570,12 @@ int smpi_main(const char* executable, int argc, char *argv[]) + "_" + std::to_string(getpid()) + "_" + std::to_string(rank++) + ".so"; - int fdout = open(target_executable.c_str(), O_WRONLY); + int fdout = open(target_executable.c_str(), O_CREAT | O_RDWR, S_IRWXU); xbt_assert(fdout >= 0, "Cannot write into %s", target_executable.c_str()); #if HAVE_SENDFILE - sendfile(fdout, fdin, NULL, fdin_size); + off_t offset = 0; + sendfile(fdout, fdin, &offset, fdin_size); #else XBT_WARN("Copy %d bytes into %s", static_cast(fdin_size), target_executable.c_str()); const int bufsize = 1024 * 1024 * 4;