Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
These defines are useless.
[simgrid.git] / src / surf / workstation.cpp
index 6703847..7274418 100644 (file)
@@ -10,8 +10,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
 
 WorkstationModelPtr surf_workstation_model = NULL;
 
-//FIXME:Faire hériter ou composer de cup et network
-
 /*************
  * CallBacks *
  *************/
@@ -378,6 +376,29 @@ xbt_dynar_t WorkstationCLM03::getInfo( surf_file_t fd)
   return info;
 }
 
+sg_size_t WorkstationCLM03::fileTell(surf_file_t fd){
+  return fd->current_position;
+}
+
+int WorkstationCLM03::fileSeek(surf_file_t fd, sg_size_t offset, int origin){
+
+  switch (origin) {
+  case SEEK_SET:
+    fd->current_position = 0;
+       return MSG_OK;
+  case SEEK_CUR:
+       if(offset > fd->size)
+         offset = fd->size;
+       fd->current_position = offset;
+       return MSG_OK;
+  case SEEK_END:
+       fd->current_position = fd->size;
+       return MSG_OK;
+  default:
+       return MSG_TASK_CANCELED;
+  }
+}
+
 sg_size_t WorkstationCLM03::getFreeSize(const char* name)
 {
   StoragePtr st = findStorageOnMountList(name);