Xref: utzoo comp.unix.wizards:11732 comp.lang.c:13268 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!bionet!agate!labrea!decwrl!sun!pitstop!sundc!seismo!uunet!vsi!friedl From: friedl@vsi.COM (Stephen J. Friedl) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: Record-access libraries (with query on NFS) Summary: Burned by raw I/O Message-ID: <881@vsi.COM> Date: 14 Oct 88 14:42:09 GMT References: <287@cvbnet2.UUCP> <10467@tekecs.TEK.COM> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 19 In article <10467@tekecs.TEK.COM>, andrew@frip.gwd.tek.com (Andrew Klossner) writes: > Yes. But note: a raw disk does NOT support a byte stream model (at > least under Berkeley). It implements a block model only. An > application that tries to do a read(2) or write(2) beginning with a > byte that does not begin a block will find that its lseek pointer is > rounded down to the beginning of the block. This burned some > application writers here. In addition, sometimes you'll get the *whole block* even if you request just a couple of bytes. We got burned by it by moving some code from the 3B2 (allows byte-at-a-time raw reads) to another machine that didn't. We found lots of memory getting trashed, and (vague recollection here) the return value from read(2) indicated that the requested amount had been read, not the whole block. -- Steve Friedl V-Systems, Inc. +1 714 545 6442 3B2-kind-of-guy friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl ---------Nancy Reagan on the Three Stooges: "Just say Moe"---------