mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
sandbox: add lseek helper
Follow up patches want to be able to seek fd's. Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
@@ -45,6 +45,19 @@ ssize_t os_write(int fd, const void *buf, size_t count)
|
||||
return write(fd, buf, count);
|
||||
}
|
||||
|
||||
off_t os_lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
if (whence == OS_SEEK_SET)
|
||||
whence = SEEK_SET;
|
||||
else if (whence == OS_SEEK_CUR)
|
||||
whence = SEEK_CUR;
|
||||
else if (whence == OS_SEEK_END)
|
||||
whence = SEEK_END;
|
||||
else
|
||||
os_exit(1);
|
||||
return lseek(fd, offset, whence);
|
||||
}
|
||||
|
||||
int os_open(const char *pathname, int flags)
|
||||
{
|
||||
return open(pathname, flags);
|
||||
|
||||
Reference in New Issue
Block a user