Rev 8790 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8687 | turbocat | 1 | #include |
2 | #include |
||
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; |
||
8790 | turbocat | 17 | return 0; |
8687 | turbocat | 18 | } |