Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
somehow off_t is not enough there, and ends up being negative on some 32 bits systems
authordegomme <augustin.degomme@unibas.ch>
Wed, 22 Feb 2017 17:20:12 +0000 (18:20 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Wed, 22 Feb 2017 17:20:43 +0000 (18:20 +0100)
src/mc/Process.cpp

index df7ef3c..7ffd7b3 100644 (file)
@@ -498,8 +498,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size,
     }
 #endif
   }
     }
 #endif
   }
-
-  if (pread_whole(this->memory_file, buffer, size, (off_t) address.address()) < 0)
+  if (pread_whole(this->memory_file, buffer, size, (size_t) address.address()) < 0)
     xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
   return buffer;
 }
     xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
   return buffer;
 }
@@ -512,7 +511,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size,
  */
 void Process::write_bytes(const void* buffer, size_t len, RemotePtr<void> address)
 {
  */
 void Process::write_bytes(const void* buffer, size_t len, RemotePtr<void> address)
 {
-  if (pwrite_whole(this->memory_file, buffer, len, address.address()) < 0)
+  if (pwrite_whole(this->memory_file, buffer, len,  (size_t)address.address()) < 0)
     xbt_die("Write to process %lli failed", (long long) this->pid_);
 }
 
     xbt_die("Write to process %lli failed", (long long) this->pid_);
 }