Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2009 15:10:24 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Lukasz Jaroszewski <lvj@nietykalni.org>
Cc:        freebsd-hackers@freebsd.org, Christoph Mallon <christoph.mallon@gmx.de>
Subject:   Re: write(2) to /dev/ad4 = EINVAL
Message-ID:  <200901261510.25074.hselasky@c2i.net>
In-Reply-To: <3930e0780901260504m44f43958m82f2ba8902558906@mail.gmail.com>
References:  <3930e0780901260135j1428e77fmfe7392770fcd31fc@mail.gmail.com> <497D9116.1040408@gmx.de> <3930e0780901260504m44f43958m82f2ba8902558906@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 26 January 2009, Lukasz Jaroszewski wrote:
> 2009/1/26 Christoph Mallon <christoph.mallon@gmx.de>:
> > Lukasz Jaroszewski schrieb:
> >> 2009/1/26 Hans Petter Selasky <hselasky@c2i.net>:
> >>> On Monday 26 January 2009, Lukasz Jaroszewski wrote:

Hi,

> > It would be helpful, if you showed the actual code, instead of letting =
us
> > guess what you are doing.
>
> Ok, I solved that, I were trying to dd with bs correctly set, tho
> if=3D./s wasn't big enough plus I had code like below, where I didn't
> check write for errors, just called perror, which gave me wrong errno.
>
> So to change one byte, I need to read it, change it, and write it in
> 512 chunks?=20

Yes! Maybe you should not write single bytes at a time in your design.

> or play with kernel and add smth like ``write_byte'' to=20
> ata?

=46rom my knowledge there is no standard harddisk command or SCSI command t=
hat=20
can change only one byte at a time of the disk. It is all block based. And=
=20
note that the block size can be different from 512 bytes.

=2D-HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901261510.25074.hselasky>