Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar and simplify simcalls (before killing them)
[simgrid.git] / src / surf / FileImpl.hpp
index e8ae85b..b50fa8f 100644 (file)
@@ -26,6 +26,23 @@ public:
   void setPosition(sg_size_t size) { current_position_ = size; }
   void incrPosition(sg_size_t incr) { current_position_ += incr; }
   sg_size_t tell() { return current_position_; }
+  int seek(sg_offset_t offset, int origin)
+  {
+    switch (origin) {
+      case SEEK_SET:
+        current_position_ = offset;
+        return 0;
+      case SEEK_CUR:
+        current_position_ += offset;
+        return 0;
+      case SEEK_END:
+        current_position_ = size_ + offset;
+        return 0;
+      default:
+        return -1;
+    }
+  }
+
 private:
   std::string path_;
   std::string mount_point_;