Raw disk i/o

Derek Martin invalid at pizzashack.org
Tue Aug 19 00:21:25 EDT 2003


On Mon, Aug 18, 2003 at 11:13:48PM -0400, Jeff Macdonald wrote:
> Hi,
> I am trying to understand how one uses raw disk i/o in Linux. I

If you're not a filesystem engineer, you probably just really don't
want to do this.  This is the level at which the filesystem reads and
writes data -- it is a raw byte stream.  If you write data at this
level, you will destroy your filesystem. 

> understand that the i/o skips the kernel buffer. 

Well, IIRC, unlike most other Unix implementations, Linux disk I/O is
/always/ block I/O (i.e. buffered by the kernel) unless you apply
patches to the kernel.

However, if what you're trying to do is avoid a layer of buffers to
increase performance, have a look at memory-mapped I/O.  See the man
page for mmap(2), and/or a good book on programming on Unix systems.
I'd suggest W. Richard Stevens' "Advanced Programming in the Unix
Environment" for starters.


-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.
Replying to it will result in undeliverable mail.
Sorry for the inconvenience.  Thank the spammers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20030819/017e9063/attachment.bin


More information about the gnhlug-discuss mailing list