Subject: Re: New read & write syscalls
To: None <tech-kern@netbsd.org>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 06/30/1999 11:39:12
On Wed, 30 Jun 1999, Ignatios Souvatzis wrote:

> On Wed, Jun 30, 1999 at 11:16:34AM -0700, Bill Studenmund wrote:
> > readwrite(int fd, void *buf, size_t nbyte, int flags, off_t offset)
> > 
> > and
> > 
> > readwritev(int fd, const struct iovec *iovp, int iovcnt, int flags, off_t
> > 		offset)
> > 
> > The only difference between the two calls is that one takes a pointer to a
> > buffer and a byte count, while the other takes iovec's.
> 
> Something that I've been wondering for a while, but never seemed important...
> 
> why not implement the first as a library call using the 2nd (using alloca
> to create the one-element iovec)?
> 
> (actually, why not reimplent read/write in the same way?)

Speed is the issue which comes to mind. Why add the extra alloc if you
really don't need it? :-)

Take care,

Bill