#include #include int fseek(FILE *fp, long offset, int whence) { if(fflush(fp) == EOF) return -1; off_t rc = lseek(fp->fd, offset, whence); if(rc < 0) return -1; fp->fdpos = rc; fp->eof = 0; return 0; }