[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64
From: |
Seth Goldberg |
Subject: |
Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64 |
Date: |
Fri, 3 Dec 2010 13:20:13 -0800 (PST) |
User-agent: |
Alpine 2.00 (GSO 1167 2008-08-23) |
Hi,
In testing grub-emu after a merge, I was getting weird behavior whereby a
zfs volume could not be properly read. It was failing because, after a lot of
painful debugging, I discovered that the offsets issued to the underlying host
disk device were wrong, because the grub-emu was not build
largefile-aware on platform on which I was testing. grub-emu should be built
with -DLARGEFILE_SOURCE and _FILE_OFFSET_BITS=64 so that off_t will be defined
as a 64-bit type and calls like lseek will work with large files (and
devices). So, I think a configure test for this for the emu target is
essential. Note that most major platforms in hostdisk.c are covered by their
own #ifdef'ed code -- it's the common case of:
off_t offset = (off_t) sector << GRUB_DISK_SECTOR_BITS;
if (lseek (fd, offset, SEEK_SET) != offset)
{
grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'",
map[disk->id].device);
close (fd);
return -1;
}
that exposes the problem, since without LARGEFILE_SOURCE and
_FILE_OFFSET_BITS, off_t defaults to a 32-bit quantity.
--S
- Re: Need --divide flag for assembly of startup.S on some platforms, (continued)
- Re: Need --divide flag for assembly of startup.S on some platforms, Colin Watson, 2010/12/02
- Re: Need --divide flag for assembly of startup.S on some platforms, Seth Goldberg, 2010/12/02
- Error building grub-emu (gnulib/progname.c), Seth Goldberg, 2010/12/02
- Re: Error building grub-emu (gnulib/progname.c), Seth Goldberg, 2010/12/02
- Re: Error building grub-emu (gnulib/progname.c), Seth Goldberg, 2010/12/02
- Another error building grub-emu (gnulib/error.c), Seth Goldberg, 2010/12/02
- Re: Another error building grub-emu (gnulib/error.c), Seth Goldberg, 2010/12/02
- Re: Need --divide flag for assembly of startup.S on some platforms, Vladimir 'φ-coder/phcoder' Serbinenko, 2010/12/02
- Re: Need --divide flag for assembly of startup.S on some platforms, Colin Watson, 2010/12/04
- Re: Need --divide flag for assembly of startup.S on some platforms, Colin Watson, 2010/12/04
- Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64,
Seth Goldberg <=
- Re: Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64, Colin Watson, 2010/12/04
- Re: Need LARGEFILE_SOURCE && _FILE_OFFSET_BITS=64, Seth Goldberg, 2010/12/06
Re: BtrFS available in experimental, Vladimir 'φ-coder/phcoder' Serbinenko, 2010/12/03