Support lseek64.
Android doesn't have 64-bit off_t, so use off64_t instead.
This commit is contained in:
parent
7171645366
commit
4152833f0c
2 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue