Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. #include <stdio.h>
  2. #include <ksys.h>
  3.  
  4. int fseek(FILE *stream, long int offset, int whence) {
  5.         if (whence == SEEK_SET) {
  6.                 stream->position = offset;
  7.         } else if (whence == SEEK_CUR) {
  8.                 stream->position += offset;
  9.         } else if (whence == SEEK_END) {
  10.                 ksys_bdfe_t info;
  11.             if (_ksys_file_get_info(stream->name, &info)) {
  12.                 return -1;
  13.             }
  14.             stream->position = info.size + offset;
  15.         }
  16.         stream->eof = 0;
  17. }
  18.