#include #include int fsetpos(FILE *fp, fpos_t const *pos) { if(fflush(fp) == EOF) return -1; off_t rc = lseek(fp->fd, *pos, SEEK_SET); if(rc < 0) return -1; fp->fdpos = *pos; fp->eof = 0; return 0; }