read/write less than sector size

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Wed Nov 10 07:42:38 PST 2004


On 10.11.2004, at 16:36, Nehal wrote:

> if i open /dev/ad1s1 for example, i try to read() or write()
> not in multiples of 512, it will return an error.
>
> how would i do this? currently, if i need to read 100 bytes,
> i read in the full sector, then memcpy the bytes i need.
>
> is there a better way?

maybe mmap the device if that's possible?

cheers
   simon

-- 
/"\
\ /
  \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20041110/b5783d03/PGP.bin


More information about the freebsd-hackers mailing list