Subject: Re: newfs: determining file system parameters
To: Greg 'groggy' Lehey <grog@NetBSD.org>
From: Eduardo Horvath <eeh@NetBSD.org>
List: tech-kern
Date: 10/11/2003 17:56:19
On Sat, Oct 11, 2003 at 01:53:46PM +0930, Greg 'groggy' Lehey wrote:

> Of all these parameters, only the following require information from
> the partition table: block size, frag size, file system size.  Of
> these, only the file system size doesn't have a default.
> 
> In addition to these parameters, newfs interprets the last letter of
> the device name as a partition identifier.  This can fail badly if a
> device has a name like 'baz'.
> 
> I'd suggest that the following method would solve the "problem":
> 
> - implement an ioctl DIOCGMEDIASIZE to return the size of a special
>   device.  

Why doesn't newfs simply use lseek(2) to find the size of the device/file?

Eduardo