mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Implemented the fdio backend of fseek(3) and ftell(3).
This commit is contained in:
parent
648b324385
commit
912b2f78f0
1 changed files with 2 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue