Subversion Repositories Kolibri OS

Rev

Rev 6412 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2. int fseek(FILE* file,long offset,int origin)
  3. {
  4.     fpos_t pos;
  5.     if(!file)
  6.     {
  7.         errno = E_INVALIDPTR;
  8.         return errno;
  9.     }
  10.  
  11.         if (origin==SEEK_CUR)
  12.                 offset+=file->filepos;
  13.         else if (origin==SEEK_END)
  14.                 offset+=file->filesize;
  15.         else if (origin!=SEEK_SET)
  16.                 return EOF;
  17.         pos = offset;
  18.         return fsetpos(file, &pos);
  19. }
  20.