X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0358b2afff91122d7760953b208c84e22bf1d71c..e0d3b66cb9e29820cb06538de0c803f58e942794:/src/surf/workstation.cpp diff --git a/src/surf/workstation.cpp b/src/surf/workstation.cpp index ff9c71a390..7274418b2d 100644 --- a/src/surf/workstation.cpp +++ b/src/surf/workstation.cpp @@ -380,6 +380,25 @@ 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);