Small efficiency nit, you say. True, EXCEPT for the fact that
the 4.2 TCP sets the TCP_PUSH bit at the end of each sys-write.
This can have extreme effects on network performance.
Note that readv() and writev() have a maximum vector length
of 16 items in 4.2 BSD. You will find this limit strictly enforced
by the kernel, and perplexing to the unwary.
-Mike
bcopy() is about 4 times as fast as pipes for copying data.
On raw devices, physio() generates a physical I/O for each element
of a readv() or writev().
The far more common read() and write() are implemented in terms of
the more complicated readv() and writev(), slowing down the former
two system calls. I doubt that the gains of readv() and writev()
are used frequently enough to win back the speed loss to read()
and write(). Really now, how often do you call perror()?
Don Speck sp...@vlsi.caltech.edu {seismo,rutgers}!cit-vax!speck
I was wrong; only one I/O is generated, because readv() and writev()
on the raw device won't do more than a single iovec, due to bugs in
physio(). 4.3bsd fixes one of the bugs, but there's still at least
one bug left: writev() fails on the second iovec, with errno=ENXIO.
If readv() and writev() were useful, someone would have fixed this.