From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 26 17:08:02 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3669106566B for ; Mon, 26 Jan 2009 17:08:02 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swipnet.se [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id 6864D8FC0A for ; Mon, 26 Jan 2009 17:08:02 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=2V2iuldQSBbWmav1FwkA:9 a=elbioWvLvWQVDFzLKO4A:7 a=QvjUidVIBIIgDWhrYG5pwPrywScA:4 a=_RhRFcbxBZMA:10 a=9aOQ2cSd83gA:10 a=LY0hPdMaydYA:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 440169506; Mon, 26 Jan 2009 15:07:59 +0100 From: Hans Petter Selasky To: Lukasz Jaroszewski Date: Mon, 26 Jan 2009 15:10:24 +0100 User-Agent: KMail/1.9.7 References: <3930e0780901260135j1428e77fmfe7392770fcd31fc@mail.gmail.com> <497D9116.1040408@gmx.de> <3930e0780901260504m44f43958m82f2ba8902558906@mail.gmail.com> In-Reply-To: <3930e0780901260504m44f43958m82f2ba8902558906@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200901261510.25074.hselasky@c2i.net> Cc: freebsd-hackers@freebsd.org, Christoph Mallon Subject: Re: write(2) to /dev/ad4 = EINVAL X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2009 17:08:03 -0000 On Monday 26 January 2009, Lukasz Jaroszewski wrote: > 2009/1/26 Christoph Mallon : > > Lukasz Jaroszewski schrieb: > >> 2009/1/26 Hans Petter Selasky : > >>> 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