Implemented the fdio backend of fseek(3) and ftell(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2011-12-26 23:15:52 +01:00
parent 648b324385
commit 912b2f78f0
1 changed files with 2 additions and 6 deletions

View File

@ -77,17 +77,13 @@ static size_t fdio_write(const void* ptr, size_t size, size_t nmemb, void* user)
static int fdio_seek(void* user, long offset, int whence)
{
fdio_t* fdio = (fdio_t*) user;
// TODO: lseek(2) is not implemented yet!
errno = EINVAL;
return -1;
return (int) lseek(fdio->fd, offset, whence);
}
static long fdio_tell(void* user)
{
fdio_t* fdio = (fdio_t*) user;
// TODO: lseek(2) is not implemented yet!
errno = EINVAL;
return -1;
return (int) lseek(fdio->fd, 0, SEEK_CUR);
}
static void fdio_clearerr(void* user)