[haiku-development] Re: [RFC] seek(SEEK_END) on block devices

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 04 Nov 2014 20:08:13 +0100

On 28/10/2014 15:43, Axel Dörfler wrote:
> Am 28.10.2014 15:32, schrieb François Revol:
>> On 28/10/2014 15:01, François Revol wrote:
>>> It seems like some programs now use lseek(SEEK_END) to determine block
>>> devices size, instead of non-portable ioctls() like BLKGETSIZE64.
> [...]
>>> I'm wondering about adding support for it in the vfs.
> 
> I wouldn't mind it at all. We already return a valid file size if I'm
> not mistaken, so that extra step wouldn't really make things any worse :-)

Looks like I'll have to do it anyway, as they just refused my patch.

Oddly enough, it seems the partition layer does publish them as block
device and with the size reported in stat(), I never noticed that:

/dev/disk/ata/0/master:
total 0
drwxr-xr-x 1 user root        0 2014-11-04 21:01 .
drwxr-xr-x 1 user root        0 2014-11-04 21:01 ..
brw-r--r-- 1 user root 4293918720 2014-11-04 21:01 0
crw-r--r-- 1 user root        0 2014-11-04 21:01 raw

/dev/disk/ata/0/slave:
total 0
drwxr-xr-x 1 user root        0 2014-11-04 21:01 .
drwxr-xr-x 1 user root        0 2014-11-04 21:01 ..
brw-r--r-- 1 user root 21459755520 2014-11-04 21:01 0
crw-r--r-- 1 user root        0 2014-11-04 21:01 raw

François.

Other related posts: