Walt Mankowski on Wed, 28 Nov 2001 01:20:19 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] c++ fs calls


On Tue, Nov 27, 2001 at 06:32:05PM -0500, gabriel rosenkoetter wrote:
> The big plus for read(2) and write(2) are that they work not just
> to files but also to sockets, named pipes, and so forth through the
> same interface. What's more, I do think they're more efficient,
> privided they're written with at least a little bit of sanity. At
> the least, they're sycalls (they have to be, they're accessing a vfs
> and, most likely, a physical device), which means that the kernel
> can manhandle the memory in order to do the read or write operation.

The biggest minus for read() and write() is that they're unbuffered.
Streams accessed through the stdio.h calls are buffered by default.
setbuf(3) and friends are used to change the buffering.

Walt

Attachment: pgp1u5EGJKvJd.pgp
Description: PGP signature