I don't have much experience developing under FreeBSD but this call taken from 
the fdisk source code seems to work (see attachment also):

error = ioctl(fd, DIOCGMEDIASIZE, &size);

Thanks,
Andrey


--- On Sat, 12/13/08, Robert Millan <r...@aybabtu.com> wrote:

> From: Robert Millan <r...@aybabtu.com>
> Subject: Re: stat for FreeBSD
> To: "The development of GRUB 2" <grub-devel@gnu.org>
> Date: Saturday, December 13, 2008, 8:12 PM
> On Tue, Dec 09, 2008 at 03:26:28PM -0800, Andrey Shuvikov
> wrote:
> > Hello,
> > 
> > I tried to compile Grub2 under FreeBSD, it compiles
> but doesn't work (grub-setup). The problem seems to be
> in the stat() call, which is used to determine disk size.
> The call returns 0 for st_size, and grub-setup complains for
> "Read out of range". Is it a known issue? Is there
> a way to use Grub2 under FreeBSD?
> 
> Do you know how to obtain the disk size on FreeBSD ?
> 
> -- 
> Robert Millan
> 
>   The DRM opt-in fallacy: "Your data belongs to us. We
> will decide when (and
>   how) you may access your data; but nobody's
> threatening your freedom: we
>   still allow you to remove your data and not access it at
> all."
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel


      

Attachment: getsize.c
Description: Binary data

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to