1 2 3 4 5 6 7 8 9 10
#include <dietstdio.h> #include <unistd.h> int fseek(FILE *stream, long offset, int whence) { fflush(stream); stream->bm=0; stream->bs=0; stream->flags&=~(ERRORINDICATOR|EOFINDICATOR); stream->ungotten=0; return lseek(stream->fd,offset,whence)!=-1?0:-1; }