Implemented the fdio backend of fseek(3) and ftell(3).
This commit is contained in:
parent
648b324385
commit
912b2f78f0
|
@ -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)
|
static int fdio_seek(void* user, long offset, int whence)
|
||||||
{
|
{
|
||||||
fdio_t* fdio = (fdio_t*) user;
|
fdio_t* fdio = (fdio_t*) user;
|
||||||
// TODO: lseek(2) is not implemented yet!
|
return (int) lseek(fdio->fd, offset, whence);
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static long fdio_tell(void* user)
|
static long fdio_tell(void* user)
|
||||||
{
|
{
|
||||||
fdio_t* fdio = (fdio_t*) user;
|
fdio_t* fdio = (fdio_t*) user;
|
||||||
// TODO: lseek(2) is not implemented yet!
|
return (int) lseek(fdio->fd, 0, SEEK_CUR);
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fdio_clearerr(void* user)
|
static void fdio_clearerr(void* user)
|
||||||
|
|
Loading…
Reference in New Issue