Support lseek64.

Android doesn't have 64-bit off_t, so use off64_t instead.
This commit is contained in:
Vladimir Serbinenko committed 2017-01-27 20:12:00 +00:00
1 parent f0cdef6ef5
commit 55d849f1f7
2 files changed
+12 -1

No files matched your search

+8
View File
@@ -77,11 +77,19 @@ grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsiz
int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
{
#if SIZEOF_OFF_T == 8
off_t offset = (off_t) off;
if (lseek (fd, offset, SEEK_SET) != offset)
return -1;
#elif SIZEOF_OFF64_T == 8
off64_t offset = (off64_t) off;
if (lseek64 (fd, offset, SEEK_SET) != offset)
return -1;
#else
#error "No large file support"
#endif
return 0;
}