14 lines
198 B
C
14 lines
198 B
C
|
#include <stdio.h>
|
||
|
#include <unistd.h>
|
||
|
|
||
|
int fsetpos(FILE *fp, fpos_t const *pos)
|
||
|
{
|
||
|
if(fflush(fp) == EOF)
|
||
|
return -1;
|
||
|
|
||
|
lseek(fp->fd, *pos, SEEK_SET);
|
||
|
fp->fdpos = *pos;
|
||
|
fp->eof = 0;
|
||
|
return 0;
|
||
|
}
|