From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 10 15:42:38 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 42D5516A4CE for ; Wed, 10 Nov 2004 15:42:38 +0000 (GMT) Received: from stella.fs.ei.tum.de (stella.fs.ei.tum.de [129.187.54.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7450743D2F for ; Wed, 10 Nov 2004 15:42:35 +0000 (GMT) (envelope-from corecode@fs.ei.tum.de) Received: from localhost (localhost [127.0.0.1]) by localhost.fs.ei.tum.de (Postfix) with ESMTP id DFC5F30279; Wed, 10 Nov 2004 16:42:29 +0100 (CET) Received: from [10.150.180.176] (r180176.olydorf.swh.mhn.de [10.150.180.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client did not present a certificate) by stella.fs.ei.tum.de (Postfix) with ESMTP id EF98B30212; Wed, 10 Nov 2004 16:42:25 +0100 (CET) In-Reply-To: <41923564.7W4yXnkn0Ia1Jjug%nehalmistry@gmx.net> References: <41923564.7W4yXnkn0Ia1Jjug%nehalmistry@gmx.net> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-12--612429271" Message-Id: <1A8C11E2-332F-11D9-8841-000A95B5756A@fs.ei.tum.de> Content-Transfer-Encoding: 7bit From: Simon 'corecode' Schubert Date: Wed, 10 Nov 2004 16:42:18 +0100 To: Nehal X-Pgp-Agent: GPGMail 1.0.1 (v33, 10.3) X-Mailer: Apple Mail (2.619) X-Virus-Scanned: by AMaViS 0.3.12 cc: FreeBSD Hackers Subject: Re: read/write less than sector size X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2004 15:42:38 -0000 --Apple-Mail-12--612429271 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed 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 --Apple-Mail-12--612429271 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFBkjbfr5S+dk6z85oRAlj+AKD7V0RM/+DjipAgCoiKAOYUkG1fFQCfZPs8 b72h5gnDqb2+ruEIT2SPkdc= =OWRF -----END PGP SIGNATURE----- --Apple-Mail-12--612429271--