Record-access libraries (with query on NFS)
John Chambers
jc at minya.UUCP
Tue Oct 18 06:21:36 AEST 1988
> If you access the raw disk device do you disable that read-ahead and
> write-behind aspect of the UNIX filesystem abstraction?
Oh, wow! A question with a simple answer: Yes. According to several
manuals, the main difference between /dev/dsk* and /dev/rdsk* is that
there is no buffering for the latter. Reads always delay for physical
I/O, and writes always go immediately to disk (though with DMA, the
write may not be complete when write() returns). There's also a
warning that the raw disks should be only accessed in multiples of
a sector. In fact, most programs use multiples of BUFSIZ, which
is invariably a multiple of a sector.
The exact wording in one of the manuals describes the "'raw' interface
which provides for direct transmission between the disk and the user's
read or write buffer. A single read or write call results in exactly
one I/O operation and therefore raw I/O is considerably more efficient
when many words are transmitted." Note the specific claim that the
transfer is direct between the disk and the buffer in user space,
without going through a kernel buffer.
Of course, this is all at the whim of the driver, so some vendors
could have screwed it up...
--
John Chambers <{adelie,ima,maynard,mit-eddie}!minya!{jc,root}> (617/484-6393)
[Any errors in the above are due to failures in the logic of the keyboard,
not in the fingers that did the typing.]
More information about the Comp.lang.c
mailing list